X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=sha1_file.c;h=9978a58da68bbf6f3482545d9f290fbfa3f3fe34;hb=e5f4e214636f9c9bd36c2897634108d5ad5587a1;hp=aca741b79ce3cdc28f0eb5bdc6848ddba6da8f35;hpb=a6954452ecf757523b31d6eaaf7e00c7a2d91e46;p=git.git diff --git a/sha1_file.c b/sha1_file.c index aca741b79..9978a58da 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -497,7 +497,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p) */ if (idx_size != 4*256 + nr * 24 + 20 + 20) { munmap(idx_map, idx_size); - return error("wrong index file size in %s", path); + return error("wrong index v1 file size in %s", path); } } else if (version == 2) { /* @@ -519,7 +519,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p) max_size += (nr - 1)*8; if (idx_size < min_size || idx_size > max_size) { munmap(idx_map, idx_size); - return error("wrong index file size in %s", path); + return error("wrong index v2 file size in %s", path); } if (idx_size != min_size) { /* make sure we can deal with large pack offsets */ @@ -1570,6 +1570,10 @@ static void *unpack_delta_entry(struct packed_git *p, (uintmax_t)base_offset, p->pack_name); delta_data = unpack_compressed_entry(p, w_curs, curpos, delta_size); + if (!delta_data) + die("failed to unpack compressed delta" + " at %"PRIuMAX" from %s", + (uintmax_t)curpos, p->pack_name); result = patch_delta(base, base_size, delta_data, delta_size, sizep);