On Mon, Jun 28, 2010 at 09:01:57AM +0200, Bert Wesarg wrote:
'git notes copy' dumps core when no arguments are given.
How about:
-- >8 --
Subject: [PATCH] notes: check number of parameters to "git notes copy"
Otherwise we may segfault with too few parameters.
Signed-off-by: Jeff King <redacted>
---
builtin/notes.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin/notes.c b/builtin/notes.c
index f1f53a8..190005f 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -613,8 +613,12 @@ static int copy(int argc, const char **argv, const char *prefix)
return notes_copy_from_stdin(force, rewrite_cmd);
}
}
+ 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);
}--
1.7.1.777.gd07fd