* [PATCH] avoid off-by-one error in run_upload_archive
@ 2008-06-28 16:04 Jochen Voss
0 siblings, 0 replies; only message in thread
From: Jochen Voss @ 2008-06-28 16:04 UTC (permalink / raw)
To: git; +Cc: gitster
Make sure that buf has enough space to store the trailing \0 of
the command line argument, too.
Signed-off-by: Jochen Voss <voss@seehuhn.de>
---
builtin-upload-archive.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-upload-archive.c b/builtin-upload-archive.c
index 48ae09e..371400d 100644
--- a/builtin-upload-archive.c
+++ b/builtin-upload-archive.c
@@ -30,7 +30,7 @@ static int run_upload_archive(int argc, const char **argv, const char *prefix)
if (argc != 2)
usage(upload_archive_usage);
- if (strlen(argv[1]) > sizeof(buf))
+ if (strlen(argv[1]) + 1 > sizeof(buf))
die("insanely long repository name");
strcpy(buf, argv[1]); /* enter-repo smudges its argument */
--
1.5.3.7
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-28 16:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-28 16:04 [PATCH] avoid off-by-one error in run_upload_archive Jochen Voss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox