@matheusbsbs / matheus-bagliano / commits / f7de5a56b7
Fork 0

reachable.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:48 UTC f7de5a56b75109e1d6651ee2b5bf7f496a5eb18b
1 file changed +4
reachable.c
+4
@@ -15,6 +15,8 @@ static void process_blob(struct blob *blob,
15 {
16 struct object *obj = &blob->object;
17
18 + if (!blob)
19 + die("bad blob object");
20 if (obj->flags & SEEN)
21 return;
22 obj->flags |= SEEN;
@@ -39,6 +41,8 @@ static void process_tree(struct tree *tree,
41 struct name_entry entry;
42 struct name_path me;
43
44 + if (!tree)
45 + die("bad tree object");
46 if (obj->flags & SEEN)
47 return;
48 obj->flags |= SEEN;