[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 <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Sergey Vlasov 2005-08-19 22:28:35 +04:00 committed by Junio C Hamano
parent cc5625a5e2
commit 7f1335c74c

View File

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