Skip to content

Commit

Permalink
list-objects.c::process_tree/blob: check for NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Koegler authored and Junio C Hamano committed Feb 19, 2008
1 parent c340663 commit a301b0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions list-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a301b0c

Please sign in to comment.