git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] builtin-apply: fix typo leading to stack corruption

From
Imre Deak <imre.deak@gmail.com>
Date
Oct 8, 2008, 21:24 UTC
Message-ID
<48ed30f5.0707d00a.2994.6f1e@mx.google.com>
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(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index 20bef1f..720dc7f 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -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);
-- 
1.6.0.2.308.g754c
Next: Junio C Hamano
Message 1 of 5 in “builtin-apply: fix typo leading to stack corruption”
  1. builtin-apply: fix typo leading to stack corruptionImre Deak, Oct 8, 2008
  2. Junio C HamanoOct 9, 2008
  3. Shawn O. PearceOct 9, 2008
  4. Brandon CaseyOct 9, 2008
  5. Shawn O. PearceOct 9, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.