All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] http-backend: Fix access beyond end of string.
@ 2009-11-14 21:10 Tarmigan Casebolt
  2009-11-14 21:10 ` [PATCH 2/2] http-backend: Let gcc check the format of more printf-type functions Tarmigan Casebolt
  2009-11-16  1:36 ` [PATCH 1/2] http-backend: Fix access beyond end of string Shawn O. Pearce
  0 siblings, 2 replies; 8+ messages in thread
From: Tarmigan Casebolt @ 2009-11-14 21:10 UTC (permalink / raw)
  To: Shawn O . Pearce, git; +Cc: Tarmigan Casebolt

Found with valgrind while looking for Content-Length corruption in
smart http.

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
 http-backend.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/http-backend.c b/http-backend.c
index f8ea9d7..ab9433d 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -634,7 +634,7 @@ int main(int argc, char **argv)
 			cmd = c;
 			cmd_arg = xmalloc(n);
 			strncpy(cmd_arg, dir + out[0].rm_so + 1, n);
-			cmd_arg[n] = '\0';
+			cmd_arg[n-1] = '\0';
 			dir[out[0].rm_so] = 0;
 			break;
 		}
-- 
1.6.5.51.g191f5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-23 17:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-14 21:10 [PATCH 1/2] http-backend: Fix access beyond end of string Tarmigan Casebolt
2009-11-14 21:10 ` [PATCH 2/2] http-backend: Let gcc check the format of more printf-type functions Tarmigan Casebolt
2009-11-16  1:39   ` Shawn O. Pearce
2009-11-16  1:36 ` [PATCH 1/2] http-backend: Fix access beyond end of string Shawn O. Pearce
2009-11-16  4:55   ` Jeff King
2009-11-16  6:12     ` Junio C Hamano
2009-11-17  4:46       ` Tarmigan
2009-11-23 17:20       ` Brian Gernhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.