1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-19 18:20:28 +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:
Imre Deak 2008-10-09 00:24:16 +03:00 committed by Shawn O. Pearce
parent 875471c510
commit b8ebe08b9a

View File

@ -1697,7 +1697,7 @@ static int match_fragment(struct image *img,
fixlen = ws_fix_copy(buf, orig, oldlen, ws_rule, NULL);
/* Try fixing the line in the target */
if (sizeof(tgtfixbuf) < tgtlen)
if (sizeof(tgtfixbuf) > tgtlen)
tgtfix = tgtfixbuf;
else
tgtfix = xmalloc(tgtlen);