git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
7ac749c
)
avoid off-by-one error in run_upload_archive
author
Jochen Voss
<redacted>
Sat, 28 Jun 2008 16:04:24 +0000
(17:04 +0100)
committer
Junio C Hamano
<redacted>
Sat, 28 Jun 2008 20:43:21 +0000
(13:43 -0700)
Make sure that buf has enough space to store the trailing \0 of
the command line argument, too.
Signed-off-by: Jochen Voss <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin-upload-archive.c
patch
|
blob
|
history
diff --git
a/builtin-upload-archive.c
b/builtin-upload-archive.c
index 48ae09e9b5268ce1f11cfba433680a147ca39f7e..371400d49a5ff9f6ce297d7af07eb3fd6426c9ee 100644
(file)
--- 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 */
git clone https://git.99rst.org/PROJECT