summaryrefslogtreecommitdiff
path: root/builtin-unpack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-12 22:26:35 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-12 22:26:35 -0800
commit7b51b77dbc71e83789f59f0cd559489115478f27 (patch)
treead480b1a976d0670c0209333134eb1444c5be8b9 /builtin-unpack-objects.c
parent3fdd37fe1520765d1d207737ab65415e3d2ca174 (diff)
parenta2d2c478f325690e1575e14e7d310fd7435d83be (diff)
downloadgit-7b51b77dbc71e83789f59f0cd559489115478f27.tar.gz
Merge branch 'np/pack-safer'
* np/pack-safer: t5303: fix printf format string for portability t5303: work around printf breakage in dash pack-objects: don't leak pack window reference when splitting packs extend test coverage for latest pack corruption resilience improvements pack-objects: allow "fixing" a corrupted pack without a full repack make find_pack_revindex() aware of the nasty world make check_object() resilient to pack corruptions make packed_object_info() resilient to pack corruptions make unpack_object_header() non fatal better validation on delta base object offsets close another possibility for propagating pack corruption
Diffstat (limited to 'builtin-unpack-objects.c')
-rw-r--r--builtin-unpack-objects.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index 9f4bdd3296..47ed610677 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -370,6 +370,8 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
base_offset = (base_offset << 7) + (c & 127);
}
base_offset = obj_list[nr].offset - base_offset;
+ if (base_offset <= 0 || base_offset >= obj_list[nr].offset)
+ die("offset value out of bound for delta base object");
delta_data = get_data(delta_size);
if (dry_run || !delta_data) {