git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 25 in “[ANNOUNCE] GIT 1.5.5”
  1. Junio C HamanoApr 9, 2008
  2. What's in git.git (stable)Junio C Hamano, Apr 9, 2008
  3. What's in git.git (stable)Junio C Hamano, Apr 14, 2008
  4. What's in git.git (stable)Junio C Hamano, Apr 19, 2008
  5. What's in git.git (stable)Junio C Hamano, Apr 27, 2008
  6. What's in git.git (stable)Junio C Hamano, May 6, 2008
  7. What's in git.git (stable)Junio C Hamano, May 14, 2008
  8. What's in git.git (stable)Junio C Hamano, May 24, 2008
  9. What's in git.git (stable)Junio C Hamano, May 30, 2008
  10. What's in git.git (stable)Junio C Hamano, Jun 2, 2008
  11. What's in git.git (stable)Junio C Hamano, Jun 13, 2008
  12. What's in git.git (stable)Junio C Hamano, Jun 18, 2008
  13. Jeff KingJun 18, 2008
  14. What's in git.git (stable)Junio C Hamano, Jun 21, 2008
  15. What's in git.git (stable)Junio C Hamano, Jun 23, 2008
  16. What's in git.git (stable)Junio C Hamano, Jun 25, 2008
  17. What's in git.git (stable)Junio C Hamano, Jul 2, 2008
  18. What's in git.git (stable)Junio C Hamano, Jul 6, 2008
  19. What's in git.git (stable)Junio C Hamano, Jul 8, 2008
  20. What's in git.git (stable)Junio C Hamano, Jul 14, 2008
  21. What's in git.git (stable)Junio C Hamano, Jul 16, 2008
  22. What's in git.git (stable)Junio C Hamano, Jul 20, 2008
  23. Lars NoschinskiJul 20, 2008
  24. Junio C HamanoJul 20, 2008
  25. Steffen ProhaskaApr 13, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.