summaryrefslogtreecommitdiff
path: root/diff-delta.c
diff options
context:
space:
mode:
authorMartin Koegler <martin.koegler@chello.at>2017-08-10 20:13:09 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-11 15:25:40 -0700
commitfed1ef9550d528dffa8891e8b2f49b486c7985bc (patch)
tree26ad49a73baf47b9ef13f55980a6c9303e7d9904 /diff-delta.c
parent4274c698f46a9bc45834c4904e7e113450c042fb (diff)
downloadgit-fed1ef9550d528dffa8891e8b2f49b486c7985bc.tar.gz
diff-delta: do not allow delta offset truncationmk/diff-delta-avoid-large-offset
Prevent generating delta offsets beyond 4G, as the xdelta used in the pack format cannot represent such large offset. Signed-off-by: Martin Koegler <martin.koegler@chello.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-delta.c')
-rw-r--r--diff-delta.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/diff-delta.c b/diff-delta.c
index 3797ce6041..ea710c44ce 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -452,6 +452,9 @@ create_delta(const struct delta_index *index,
moff += msize;
msize = left;
+ if (moff > 0xffffffff)
+ msize = 0;
+
if (msize < 4096) {
int j;
val = 0;