@matheusbsbs / matheus-bagliano / commits / b8ebe08b9a
Fork 0

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>

Imre Deak committed Oct 9, 2008 at 00:24 UTC b8ebe08b9a643f432866eb7150c3b20d59b755f2
1 file changed +1 -1
builtin-apply.c
+1 -1
@@ -1697,7 +1697,7 @@ static int match_fragment(struct image *img,
1697 fixlen = ws_fix_copy(buf, orig, oldlen, ws_rule, NULL);
1698
1699 /* Try fixing the line in the target */
1700 - if (sizeof(tgtfixbuf) < tgtlen)
1700 + if (sizeof(tgtfixbuf) > tgtlen)
1701 tgtfix = tgtfixbuf;
1702 else
1703 tgtfix = xmalloc(tgtlen);