Browse Source

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>
maint
Imre Deak 16 years ago committed by Shawn O. Pearce
parent
commit
b8ebe08b9a
  1. 2
      builtin-apply.c

2
builtin-apply.c

@ -1697,7 +1697,7 @@ static int match_fragment(struct image *img, @@ -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);

Loading…
Cancel
Save