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

[PATCH v2 1/4] am: fail if no author line is given in --rebasing mode

From
Stephan Beyer <s-beyer@gmx.net>
Date
Sep 5, 2019, 22:48 UTC
Message-ID
<20190905224833.24913-1-s-beyer@gmx.net>
This prevents a potential segmentation fault.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
 builtin/am.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/am.c b/builtin/am.c
index 1aea657a7f..71da34913c 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1272,7 +1272,8 @@ static void get_commit_info(struct am_state *state, struct commit *commit)
 	buffer = logmsg_reencode(commit, NULL, get_commit_output_encoding());

 	ident_line = find_commit_header(buffer, "author", &ident_len);
-
+	if (!ident_line)
+		die(_("no author line"));
 	if (split_ident_line(&id, ident_line, ident_len) < 0)
 		die(_("invalid ident line: %.*s"), (int)ident_len, ident_line);

--
2.23.0.43.g31ebfd7ae6.dirty
Next: Stephan Beyer
Message 1 of 5 in “am: fail if no author line is given in --rebasing mode”
  1. 1/4 am: fail if no author line is given in --rebasing modeStephan Beyer, Sep 5, 2019
  2. 3/4 pack-objects: fix maybe-uninitialized warning for index_posStephan Beyer, Sep 5, 2019
  3. 2/4 test-read-cache: fix maybe-uninitialized warning for namelenStephan Beyer, Sep 5, 2019
  4. 4/4 Silence false-positive maybe-uninitialized warnings found by gcc 9 -fltoStephan Beyer, Sep 5, 2019
  5. Stephan BeyerSep 6, 2019

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.