aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Voss <voss@seehuhn.de>2008-06-28 17:04:24 +0100
committerJunio C Hamano <gitster@pobox.com>2008-06-28 13:43:21 -0700
commit74d817cf8cf68104564cf6c93c1361f66dad1901 (patch)
treef0c09283b2cb90a64ad50d402943cf42807879b7
parent7ac749c96d143ba4f76723959892cbaddbe8ed07 (diff)
downloadgit-74d817cf8cf68104564cf6c93c1361f66dad1901.tar.gz
git-74d817cf8cf68104564cf6c93c1361f66dad1901.tar.xz
avoid off-by-one error in run_upload_archive
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-upload-archive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-upload-archive.c b/builtin-upload-archive.c
index 48ae09e9b..371400d49 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 */