X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fsck-objects.c;h=1922b6d84c51588b22553141f608c9a07182560b;hb=4feb5e8372923951f16d1ae7c330156a5e4c7797;hp=98421aab308086edc871001842dea1f8a06af71c;hpb=f5196dbb25febb15b41ef0e6569aaa1654b8533e;p=git.git diff --git a/fsck-objects.c b/fsck-objects.c index 98421aab3..1922b6d84 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)