Merge branch 'jk/apply-binary-hunk-parsing-fix' into maint

"git apply" miscounted the bytes and failed to read to the end of
binary hunks.

* jk/apply-binary-hunk-parsing-fix:
  apply: keep buffer/size pair in sync when parsing binary hunks
This commit is contained in:
Junio C Hamano
2021-10-12 13:51:37 -07:00
2 changed files with 24 additions and 0 deletions

View File

@ -1917,6 +1917,7 @@ static struct fragment *parse_binary_hunk(struct apply_state *state,
state->linenr++;
buffer += llen;
size -= llen;
while (1) {
int byte_length, max_byte_length, newsize;
llen = linelen(buffer, size);