summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2008-02-18 20:48:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-19 04:49:13 (GMT)
commitdec38c81657f02624752a65c24d72613316713f5 (patch)
tree7374e801dde04ec87a62fa4740c5a233523cac2c
parent9786f68bfcc082778aee74159540e341bb239514 (diff)
downloadgit-dec38c81657f02624752a65c24d72613316713f5.zip
git-dec38c81657f02624752a65c24d72613316713f5.tar.gz
git-dec38c81657f02624752a65c24d72613316713f5.tar.bz2
check return value from parse_commit() in various functions
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit.c3
-rw-r--r--shallow.c3
-rw-r--r--upload-pack.c3
3 files changed, 5 insertions, 4 deletions
diff --git a/commit.c b/commit.c
index 5d57450..22ce776 100644
--- a/commit.c
+++ b/commit.c
@@ -387,8 +387,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
while (parents) {
struct commit *commit = parents->item;
- parse_commit(commit);
- if (!(commit->object.flags & mark)) {
+ if (!parse_commit(commit) && !(commit->object.flags & mark)) {
commit->object.flags |= mark;
insert_by_date(commit, list);
}
diff --git a/shallow.c b/shallow.c
index dbd9f5a..ab97548 100644
--- a/shallow.c
+++ b/shallow.c
@@ -70,7 +70,8 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
cur_depth = *(int *)commit->util;
}
}
- parse_commit(commit);
+ if (parse_commit(commit))
+ die("invalid commit");
commit->object.flags |= not_shallow_flag;
cur_depth++;
for (p = commit->parents, commit = NULL; p; p = p->next) {
diff --git a/upload-pack.c b/upload-pack.c
index 51e3ec4..d1d2c2a 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -533,7 +533,8 @@ static void receive_needs(void)
/* make sure the real parents are parsed */
unregister_shallow(object->sha1);
object->parsed = 0;
- parse_commit((struct commit *)object);
+ if (parse_commit((struct commit *)object))
+ die("invalid commit");
parents = ((struct commit *)object)->parents;
while (parents) {
add_object_array(&parents->item->object,