From: Imre Deak Date: Wed, 8 Oct 2008 21:24:16 +0000 (+0300) Subject: builtin-apply: fix typo leading to stack corruption X-Git-Tag: v1.6.0.3~25 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b8ebe08b9a643f432866eb7150c3b20d59b755f2;p=git.git 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 Looks-good-by: Junio C Hamano Signed-off-by: Shawn O. Pearce --- diff --git a/builtin-apply.c b/builtin-apply.c index 2c87cf57f..74f7e7924 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -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);