diff options
| author | Junio C Hamano <junkio@cox.net> | 2006-05-04 00:17:28 -0700 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2006-05-04 00:17:28 -0700 |
| commit | 25a9ff836f638d3290eb9648aa011db4f8e7ed90 (patch) | |
| tree | 59a4eefa9d75e42bc025b914cd4ff80d1f1458e8 | |
| parent | f8098a3329887fdaebbc41120853e39de8de1a1f (diff) | |
| parent | 6d60bbefdc2a42614069024b0a38db8c2de33967 (diff) | |
| download | git-25a9ff836f638d3290eb9648aa011db4f8e7ed90.tar.xz | |
Merge branch 'jc/cache-tree' into next
* jc/cache-tree:
fsck-objects: do not segfault on missing tree in cache-tree
| -rw-r--r-- | fsck-objects.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fsck-objects.c b/fsck-objects.c index 98421aab30..1922b6d84c 100644 --- a/fsck-objects.c +++ b/fsck-objects.c @@ -446,6 +446,11 @@ static int fsck_cache_tree(struct cache_tree *it) if (0 <= it->entry_count) { struct object *obj = parse_object(it->sha1); + if (!obj) { + error("%s: invalid sha1 pointer in cache-tree", + sha1_to_hex(it->sha1)); + return 1; + } mark_reachable(obj, REACHABLE); obj->used = 1; if (obj->type != tree_type) |
