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>
Martin Koegler committed
Feb 18, 2008 at 21:47 UTC
a301b0c8f2627f0c0f4c6fd1015c6140a875d0b4
1 file changed
+4
list-objects.c
+4
@@ -18,6 +18,8 @@ static void process_blob(struct rev_info *revs,
18
19
if (!revs->blob_objects)
20
return;
21
+ if (!obj)
22
+ die("bad blob object");
23
if (obj->flags & (UNINTERESTING | SEEN))
24
return;
25
obj->flags |= SEEN;
@@ -69,6 +71,8 @@ static void process_tree(struct rev_info *revs,
71
72
if (!revs->tree_objects)
73
return;
74
+ if (!obj)
75
+ die("bad tree object");
76
if (obj->flags & (UNINTERESTING | SEEN))
77
return;
78
if (parse_tree(tree) < 0)