summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vlasov <vsu@altlinux.ru>2005-08-19 18:28:35 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-19 20:07:43 (GMT)
commit7f1335c74c4ba0baac8649974e95f6e6f84f8632 (patch)
tree247e1fc63daef1cc5a8d541afee86552ef4c1203
parentcc5625a5e2e10a94560347333c43b7032c2566f3 (diff)
downloadgit-7f1335c74c4ba0baac8649974e95f6e6f84f8632.zip
git-7f1335c74c4ba0baac8649974e95f6e6f84f8632.tar.gz
git-7f1335c74c4ba0baac8649974e95f6e6f84f8632.tar.bz2
[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>
-rw-r--r--rev-list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rev-list.c b/rev-list.c
index ce5b8b2..2ed5e87 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));
}
/*