Skip to content

Commit b8ebe08

Browse files
ideakspearce
authored andcommitted
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 <[email protected]> Looks-good-by: Junio C Hamano <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 875471c commit b8ebe08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ static int match_fragment(struct image *img,
16971697
fixlen = ws_fix_copy(buf, orig, oldlen, ws_rule, NULL);
16981698

16991699
/* Try fixing the line in the target */
1700-
if (sizeof(tgtfixbuf) < tgtlen)
1700+
if (sizeof(tgtfixbuf) > tgtlen)
17011701
tgtfix = tgtfixbuf;
17021702
else
17031703
tgtfix = xmalloc(tgtlen);

0 commit comments

Comments
 (0)