summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-28 14:47:56 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-28 14:47:56 +0900
commitfdbe2ac1983c1224ce40b465b22e44d7e22de6c4 (patch)
tree05b18283e1e37a9169149431ab5d1dbd07a1f5ce
parent3d09e79b27055107f51bdbc537c51b8a337b820a (diff)
parentfed1ef9550d528dffa8891e8b2f49b486c7985bc (diff)
downloadgit-fdbe2ac1983c1224ce40b465b22e44d7e22de6c4.tar.gz
Merge branch 'mk/diff-delta-avoid-large-offset'
The delta format used in the packfile cannot reference data at offset larger than what can be expressed in 4-byte, but the generator for the data failed to make sure the offset does not overflow. This has been corrected. * mk/diff-delta-avoid-large-offset: diff-delta: do not allow delta offset truncation
-rw-r--r--diff-delta.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/diff-delta.c b/diff-delta.c
index cd238c8ed8..e49643353b 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -454,6 +454,9 @@ create_delta(const struct delta_index *index,
moff += msize;
msize = left;
+ if (moff > 0xffffffff)
+ msize = 0;
+
if (msize < 4096) {
int j;
val = 0;