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 <martin.koegler@chello.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Martin Koegler 2017-08-10 20:13:09 +02:00 коммит произвёл Junio C Hamano
Родитель 4274c698f4
Коммит fed1ef9550
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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;