Browse Source

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
maint
Junio C Hamano 7 years ago
parent
commit
fdbe2ac198
  1. 3
      diff-delta.c

3
diff-delta.c

@ -454,6 +454,9 @@ create_delta(const struct delta_index *index, @@ -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;

Loading…
Cancel
Save