git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v2 1/4] am: fail if no author line is given in --rebasing mode
@ 2019-09-05 22:48 Stephan Beyer
  2019-09-05 22:48 ` [PATCH v2 2/4] test-read-cache: fix maybe-uninitialized warning for namelen Stephan Beyer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stephan Beyer @ 2019-09-05 22:48 UTC (permalink / raw)
  To: René Scharfe, Paul Tan, Jeff King, brian m. carlson,
	Shawn O. Pearce, Johannes Schindelin
  Cc: Stephan Beyer, git

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-06 12:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 22:48 [PATCH v2 1/4] am: fail if no author line is given in --rebasing mode Stephan Beyer
2019-09-05 22:48 ` [PATCH v2 2/4] test-read-cache: fix maybe-uninitialized warning for namelen Stephan Beyer
2019-09-05 22:48 ` [PATCH v2 3/4] pack-objects: fix maybe-uninitialized warning for index_pos Stephan Beyer
2019-09-05 22:48 ` [PATCH v2 4/4] Silence false-positive maybe-uninitialized warnings found by gcc 9 -flto Stephan Beyer
2019-09-06 12:39 ` [PATCH v2 1/4] am: fail if no author line is given in --rebasing mode Stephan Beyer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).