From bbb1b8a35a06203020f7ab6d1ad58bcb4afe8e93 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 28 Jun 2010 04:59:07 -0400 Subject: notes: check number of parameters to "git notes copy" Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King Tested-by: Bert Wesarg Signed-off-by: Junio C Hamano --- builtin/notes.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'builtin/notes.c') 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); -- cgit v1.2.1