Code

reachable.c::process_tree/blob: check for NULL
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>
Mon, 18 Feb 2008 20:48:00 +0000 (21:48 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Feb 2008 03:25:26 +0000 (19:25 -0800)
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>
reachable.c

index 11499a60c4202ba29b2dfc8bf1e6536343dfed4c..96a984c693b9f2c2c351142157c8a661f412aa82 100644 (file)
@@ -15,6 +15,8 @@ static void process_blob(struct blob *blob,
 {
        struct object *obj = &blob->object;
 
+       if (!blob)
+               die("bad blob object");
        if (obj->flags & SEEN)
                return;
        obj->flags |= SEEN;
@@ -39,6 +41,8 @@ static void process_tree(struct tree *tree,
        struct name_entry entry;
        struct name_path me;
 
+       if (!tree)
+               die("bad tree object");
        if (obj->flags & SEEN)
                return;
        obj->flags |= SEEN;