Skip to content

Commit

Permalink
Merge branch 'np/maint-huge-delta-generation'
Browse files Browse the repository at this point in the history
* np/maint-huge-delta-generation:
  fix >4GiB source delta assertion failure
  • Loading branch information
Junio C Hamano committed Aug 31, 2010
2 parents 2acf365 + 506049c commit e3efa9c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion diff-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
/* Determine index hash size. Note that indexing skips the
first byte to allow for optimizing the Rabin's polynomial
initialization in create_delta(). */
entries = (bufsize - 1) / RABIN_WINDOW;
entries = (bufsize - 1) / RABIN_WINDOW;
if (bufsize >= 0xffffffffUL) {
/*
* Current delta format can't encode offsets into
* reference buffer with more than 32 bits.
*/
entries = 0xfffffffeU / RABIN_WINDOW;
}
hsize = entries / 4;
for (i = 4; (1u << i) < hsize && i < 31; i++);
hsize = 1 << i;
Expand Down

0 comments on commit e3efa9c

Please sign in to comment.