Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
avoid off-by-one error in run_upload_archive
author
Jochen Voss
<voss@seehuhn.de>
Sat, 28 Jun 2008 16:04:24 +0000
(17:04 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
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 <voss@seehuhn.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-upload-archive.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
7ac749c
)
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 */