From: Jeff King Date: Mon, 28 Jun 2010 08:59:07 GMT Subject: Re: [PATCH] Add known breakage for 'git notes copy' Message-ID: <20100628085907.GA14014@coredump.intra.peff.net> In-Reply-To: <41768aafce7a581e8b601e70826ce77381458a23.1277708369.git.bert.wesarg@googlemail.com> 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 --- 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