aboutsummaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-06-28 04:59:07 -0400
committerJunio C Hamano <gitster@pobox.com>2010-06-28 09:15:15 -0700
commitbbb1b8a35a06203020f7ab6d1ad58bcb4afe8e93 (patch)
treec7e4500bf95872f4ffa394fef1af3ebac236a72a /builtin/notes.c
parent9eafa1201b2dcc703258ca7cd53de8ac4de74565 (diff)
downloadgit-bbb1b8a35a06203020f7ab6d1ad58bcb4afe8e93.tar.gz
git-bbb1b8a35a06203020f7ab6d1ad58bcb4afe8e93.tar.xz
notes: check number of parameters to "git notes copy"
Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King <peff@peff.net> Tested-by: Bert Wesarg <Bert.Wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index da504ee0a..f678f9cb5 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -614,6 +614,10 @@ static int copy(int argc, const char **argv, const char *prefix)
}
}
+ if (argc < 2) {
+ error("too few parameters");
+ usage_with_options(git_notes_copy_usage, options);
+ }
if (2 < argc) {
error("too many parameters");
usage_with_options(git_notes_copy_usage, options);