From: Shawn O. Pearce Date: Thu, 14 Feb 2008 06:34:34 +0000 (-0500) Subject: fast-import: check return value from unpack_entry() X-Git-Tag: v1.5.4.2~15 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e8b32e061006d1a62e464e7c2a5385ddd0cb4290;p=git.git fast-import: check return value from unpack_entry() If the tree object we have asked for is deltafied in the packfile and the delta did not apply correctly or was not able to be decompressed from the packfile then we can get back NULL instead of the tree data. This is (part of) the reason why read_sha1_file() can return NULL, so we need to also handle it the same way. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/fast-import.c b/fast-import.c index a523b171e..9b71ccc47 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1204,6 +1204,8 @@ static void load_tree(struct tree_entry *root) die("Not a tree: %s", sha1_to_hex(sha1)); t->delta_depth = myoe->depth; buf = gfi_unpack_entry(myoe, &size); + if (!buf) + die("Can't load tree %s", sha1_to_hex(sha1)); } else { enum object_type type; buf = read_sha1_file(sha1, &type, &size);