summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-08-30 23:06:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-30 23:06:04 (GMT)
commit7e3b9d15344fa5a09fe5c70270c9f2c2f75d0f90 (patch)
treeccd77cab4aa38b32c5b6caddbc4850dd5aac014c /apply.c
parente1eb13347610bd5b062377f2e8d7f807c6e89d07 (diff)
parent46d723ce57f2dd3c50504dc6f4ca73b4c392fa6f (diff)
downloadgit-7e3b9d15344fa5a09fe5c70270c9f2c2f75d0f90.zip
git-7e3b9d15344fa5a09fe5c70270c9f2c2f75d0f90.tar.gz
git-7e3b9d15344fa5a09fe5c70270c9f2c2f75d0f90.tar.bz2
Merge branch 'jk/apply-binary-hunk-parsing-fix'
"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
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/apply.c b/apply.c
index 44bc31d..4ed4b27 100644
--- a/apply.c
+++ b/apply.c
@@ -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);