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

[PATCH] archive.c: format_subst - fixed bogus argument to memchr

From
ABAriel Badichi <abadichi@bezeqint.net>
Date
Apr 23, 2008, 00:24 UTC
Message-ID
<87od81peog.fsf@sneeze.site>
Also removed a superfluous test.
Signed-off-by: Ariel Badichi <abadichi@bezeqint.net>
---
 archive.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/archive.c b/archive.c
index fb159fe..7a32c19 100644
--- a/archive.c
+++ b/archive.c
@@ -16,9 +16,9 @@ static void format_subst(const struct commit *commit,
 		const char *b, *c;
 
 		b = memmem(src, len, "$Format:", 8);
-		if (!b || src + len < b + 9)
+		if (!b)
 			break;
-		c = memchr(b + 8, '$', len - 8);
+		c = memchr(b + 8, '$', (src + len) - b - 8);
 		if (!c)
 			break;
 
-- 
1.5.5.1.57.g5909c
Next: Ariel Badichi
Message 1 of 3 in “archive.c: format_subst - fixed bogus argument to memchr”
  1. archive.c: format_subst - fixed bogus argument to memchrAriel Badichi, Apr 23, 2008
  2. Ariel BadichiApr 23, 2008
  3. René ScharfeApr 23, 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.