summaryrefslogtreecommitdiff
path: root/rev-list.c
diff options
context:
space:
mode:
authorLibravatar Sergey Vlasov <vsu@altlinux.ru>2005-08-19 22:28:35 +0400
committerLibravatar Junio C Hamano <junkio@cox.net>2005-08-19 13:07:43 -0700
commit7f1335c74c4ba0baac8649974e95f6e6f84f8632 (patch)
tree247e1fc63daef1cc5a8d541afee86552ef4c1203 /rev-list.c
parent[PATCH] Fix git-format-patch-script to handle empty messages (diff)
downloadtgif-7f1335c74c4ba0baac8649974e95f6e6f84f8632.tar.xz
[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>
Diffstat (limited to 'rev-list.c')
-rw-r--r--rev-list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rev-list.c b/rev-list.c
index ce5b8b2ad5..2ed5e87e12 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));
}
/*