Re: What's in git.git (stable)
- From
Jeff King <peff@peff.net>
- Date
- Jun 18, 2008, 10:59 UTC
- Message-ID
- <20080618105905.GA23960@sigill.intra.peff.net>
- In-Reply-To
- <7vwsknyz9m.fsf@gitster.siamese.dyndns.org>
On Wed, Jun 18, 2008 at 12:32:05AM -0700, Junio C Hamano wrote:
> I am sending this out just as the final minute preview before 1.5.6 final, > hopefully tomorrow night.
I sent out a code cleanup for remote.c yesterday that fixes a segfault:
http://mid.gmane.org/20080616161502.GA7219@sigill.intra.peff.net
I am OK if it doesn't make it in to 1.5.6, but if not, then we should at least apply the very safe one-liner that prevents the segfault. That patch is below.
-- >8 -- fix segfault with "git push bogus:bogus"
We try to guess the type of the dst half of the refspec based on the src half. If the src half is bogus, we ended up dereferencing NULL. --- remote.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/remote.c b/remote.c index 91e3b11..fd8c71a 100644 --- a/remote.c +++ b/remote.c @@ -920,7 +920,8 @@ static int match_explicit(struct ref *src, struct ref *dst, case 0: if (!memcmp(dst_value, "refs/", 5)) matched_dst = make_linked_ref(dst_value, dst_tail); - else if((dst_guess = guess_ref(dst_value, matched_src))) + else if(matched_src && + (dst_guess = guess_ref(dst_value, matched_src))) matched_dst = make_linked_ref(dst_guess, dst_tail); else error("unable to push to unqualified destination: %s\n"
-- 1.5.6.rc3.160.g2a3c9