From: Martin Koegler Date: Mon, 18 Feb 2008 20:47:56 +0000 (+0100) Subject: list-objects.c::process_tree/blob: check for NULL X-Git-Tag: v1.5.5-rc0~93^2~17 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a301b0c8f2627f0c0f4c6fd1015c6140a875d0b4;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/list-objects.c b/list-objects.c index 4ef58e7ec..c8b8375e4 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)