Skip to content

Commit

Permalink
builtin-apply: fix typo leading to stack corruption
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Imre Deak authored and Shawn O. Pearce committed Oct 9, 2008
1 parent 875471c commit b8ebe08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-apply.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit b8ebe08

Please sign in to comment.