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

[patch] Fix off by one error in show-diff.c:sq_expand

From
BRBrad Roberts <braddr@puremagic.com>
Date
Apr 17, 2005, 15:53 UTC
Message-ID
<Pine.LNX.4.44.0504170852420.2625-100000@bellevue.puremagic.com>

tree b2eb41fec5cb7a3b83b53f1eb59e59785e57cf5d parent 1c45567134945bccefc1b5fbacc2862cd8f346c4 author Brad Roberts <braddr@puremagic.com> 1113752911 -0700 committer Brad Roberts,,, <braddr@gameboy2> 1113752911 -0700

Fix off by one error in sq_expand, forgot space for the null.
Signed-off-by: Brad Roberts <braddr@puremagic.com>
 show-diff.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
Index: show-diff.c
===================================================================
--- f9e06a309f63ac6858d019b51f2172283378d2ef/show-diff.c  (mode:100644 sha1:d85d79b97a59342390bd34da09049dd58d56900f)
+++ b2eb41fec5cb7a3b83b53f1eb59e59785e57cf5d/show-diff.c  (mode:100644 sha1:462f88a67cb3a100bbf307e567eebbcf911292ce)
@@ -36,7 +36,7 @@
 	if (buf_size < cnt) {
 		free(buf);
 		buf_size = cnt;
-		buf = malloc(cnt);
+		buf = malloc(cnt+1);
 	}

 	cp = buf;
Message 1 of 1 in “Fix off by one error in show-diff.c:sq_expand”
  1. Fix off by one error in show-diff.c:sq_expandBrad Roberts, Apr 17, 2005

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.