git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add known breakage for 'git notes copy'

From
Jeff King <peff@peff.net>
Date
Jun 28, 2010, 08:59 UTC
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 <peff@peff.net>
---
 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
Previous: Bert WesargNext: Bert Wesarg
Message 2 of 5 in “Add known breakage for 'git notes copy'”
  1. Add known breakage for 'git notes copy'Bert Wesarg, Jun 28, 2010
  2. Jeff KingJun 28, 2010
  3. Bert WesargJun 28, 2010
  4. Jacob HelwigJun 28, 2010
  5. Johan HerlandJun 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.