Skip to contentSkip to conversation

builtin-apply: fix typo leading to stack corruption

PATCH In review Imre Deak 4 participants 5 messages Jun 15, 2016

lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 builtin-apply: fix typo leading to stack corruption

This typo led to stack corruption for lines with whitespace fixes and length > 1024.

---
 builtin-apply.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
builtin-apply.c +1 -1
index 20bef1f..720dc7f 100644
@@ -1696,7 +1696,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);
Signature · 1 line
1.6.0.2.308.g754c
#2 lore raw
Quoted 1 line · Junio C Hamano

Looks good and would look better with a sign-off.

I'm holding off on applying this change for a little, hoping Imre can give us a sign off, but really I don't think anyone can claim copyright to the < sign. If they can, we're in big trouble. :-)

Signature · 1 line
Shawn.
#3 lore raw
Quoted 6 lines · Shawn O. Pearce
Quoted 1 line · Junio C Hamano

Looks good and would look better with a sign-off.

I'm holding off on applying this change for a little, hoping Imre can give us a sign off, but really I don't think anyone can claim copyright to the < sign. If they can, we're in big trouble. :-)

You must have missed [email protected]

-b

#4 lore raw
Quoted 9 lines · Brandon Casey
Quoted 6 lines · Shawn O. Pearce
Quoted 1 line · Junio C Hamano

Looks good and would look better with a sign-off.

I'm holding off on applying this change for a little, hoping Imre can give us a sign off, but really I don't think anyone can claim copyright to the < sign. If they can, we're in big trouble. :-)

You must have missed [email protected]

Yes, I did. So did gmane, but marc has it. Thanks.

Signature · 1 line
Shawn.