Skip to content

Commit fed1ef9

Browse files
e9925248gitster
authored andcommitted
diff-delta: do not allow delta offset truncation
Prevent generating delta offsets beyond 4G, as the xdelta used in the pack format cannot represent such large offset. Signed-off-by: Martin Koegler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4274c69 commit fed1ef9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

diff-delta.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ create_delta(const struct delta_index *index,
452452
moff += msize;
453453
msize = left;
454454

455+
if (moff > 0xffffffff)
456+
msize = 0;
457+
455458
if (msize < 4096) {
456459
int j;
457460
val = 0;

0 commit comments

Comments
 (0)