aboutsummaryrefslogtreecommitdiffstats
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-12 13:51:37 -0700
committerJunio C Hamano <gitster@pobox.com>2021-10-12 13:51:37 -0700
commit1725c4c64b462af36a9b7e83869af2806ea9d258 (patch)
treeddbbaf8ff66ed610fcc9b6a6068569e2031d34fd /apply.c
parentb20f67a65939a9c8f43354d70ab6000f615d1804 (diff)
parent46d723ce57f2dd3c50504dc6f4ca73b4c392fa6f (diff)
downloadgit-1725c4c64b462af36a9b7e83869af2806ea9d258.tar.gz
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
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 44bc31d6eb..4ed4b27169 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);