Git development
 help / color / mirror / Atom feed
* [PATCH] git-rev-list: avoid crash on broken repository
@ 2005-08-19 18:28 Sergey Vlasov
  2005-08-19 21:30 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Vlasov @ 2005-08-19 18:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

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));
 	}
 
 	/*

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-19 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-19 18:28 [PATCH] git-rev-list: avoid crash on broken repository Sergey Vlasov
2005-08-19 21:30 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox