mirror of
https://github.com/git/git.git
synced 2024-09-29 05:01:36 +02:00
builtin-apply: fix typo leading to stack corruption
This typo led to stack corruption for lines with whitespace fixes and length > 1024. Signed-off-by: Imre Deak <imre.deak@gmail.com> Looks-good-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
875471c510
commit
b8ebe08b9a
@ -1697,7 +1697,7 @@ static int match_fragment(struct image *img,
|
|||||||
fixlen = ws_fix_copy(buf, orig, oldlen, ws_rule, NULL);
|
fixlen = ws_fix_copy(buf, orig, oldlen, ws_rule, NULL);
|
||||||
|
|
||||||
/* Try fixing the line in the target */
|
/* Try fixing the line in the target */
|
||||||
if (sizeof(tgtfixbuf) < tgtlen)
|
if (sizeof(tgtfixbuf) > tgtlen)
|
||||||
tgtfix = tgtfixbuf;
|
tgtfix = tgtfixbuf;
|
||||||
else
|
else
|
||||||
tgtfix = xmalloc(tgtlen);
|
tgtfix = xmalloc(tgtlen);
|
||||||
|
Loading…
Reference in New Issue
Block a user