提交 b8ebe08b 编写于 作者: I Imre Deak 提交者: Shawn O. Pearce

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: NImre Deak <imre.deak@gmail.com>
Looks-good-by: NJunio C Hamano <gitster@pobox.com>
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 875471c5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册