DORMANTno replies

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

From: Ariel Badichi <hidden>
Date: 2016-06-15 22:44:31
Subsystem: the rest · Maintainer: Linus Torvalds

Also removed a superfluous test.

Signed-off-by: Ariel Badichi <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help