From: Sergey Vlasov Date: Fri, 19 Aug 2005 18:28:35 +0000 (+0400) Subject: [PATCH] git-rev-list: avoid crash on broken repository X-Git-Tag: v0.99.5~10^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7f1335c74c4ba0baac8649974e95f6e6f84f8632;p=git.git [PATCH] git-rev-list: avoid crash on broken repository When following tags, check for parse_object() success and error out properly instead of segfaulting. Signed-off-by: Sergey Vlasov Signed-off-by: Junio C Hamano --- diff --git a/rev-list.c b/rev-list.c index ce5b8b2ad..2ed5e87e1 100644 --- a/rev-list.c +++ b/rev-list.c @@ -418,6 +418,8 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags) 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)); } /*