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

[PATCH] git-rev-list: avoid crash on broken repository

From
Sergey Vlasov <vsu@altlinux.ru>
Date
Aug 19, 2005, 18:28 UTC
Message-ID
<20050819182835.GA12057@procyon.home>

When following tags, check for parse_object() success and error out properly instead of segfaulting.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
---
 rev-list.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
f4ec41063d2f43b06b7c8e511108b4c9bf9e6ebe
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -418,6 +418,8 @@ static struct commit *get_commit_referen
 		if (tag_objects && !(object->flags & UNINTERESTING))
 			add_pending_object(object, tag->tag);
 		object = parse_object(tag->tagged->sha1);
+		if (!object)
+			die("bad object %s", sha1_to_hex(tag->tagged->sha1));
 	}
 
 	/*
Next: Junio C Hamano
Message 1 of 2 in “git-rev-list: avoid crash on broken repository”
  1. git-rev-list: avoid crash on broken repositorySergey Vlasov, Aug 19, 2005
  2. Junio C HamanoAug 19, 2005

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.