summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2008-02-18 21:47:56 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-18 19:25:26 -0800
commita301b0c8f2627f0c0f4c6fd1015c6140a875d0b4 (patch)
tree31317423f2fe35bcff4742ae80c1417e624ecc2e
parentc34066358a604e3ccb6afcf5679fa8a84be79936 (diff)
downloadgit-a301b0c8f2627f0c0f4c6fd1015c6140a875d0b4.tar.gz
list-objects.c::process_tree/blob: check for NULL
As these functions are directly called with the result from lookup_tree/blob, they must handle NULL. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--list-objects.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/list-objects.c b/list-objects.c
index 4ef58e7ec0..c8b8375e49 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -18,6 +18,8 @@ static void process_blob(struct rev_info *revs,
if (!revs->blob_objects)
return;
+ if (!obj)
+ die("bad blob object");
if (obj->flags & (UNINTERESTING | SEEN))
return;
obj->flags |= SEEN;
@@ -69,6 +71,8 @@ static void process_tree(struct rev_info *revs,
if (!revs->tree_objects)
return;
+ if (!obj)
+ die("bad tree object");
if (obj->flags & (UNINTERESTING | SEEN))
return;
if (parse_tree(tree) < 0)