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