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

[PATCH] git log: avoid segfault with --all-match

From
Michele Ballabio <barra_cuda@katamail.com>
Date
Mar 18, 2009, 18:06 UTC
Message-ID
<1237399576-27323-1-git-send-email-barra_cuda@katamail.com>
Avoid a segfault when the command
	git log --all-match
was issued.
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
---

Not sure if this is the right fix, nor if it would be better a warning or an error.

 grep.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/grep.c b/grep.c
index 062b2b6..cb4666d 100644
--- a/grep.c
+++ b/grep.c
@@ -190,7 +190,8 @@ void compile_grep_patterns(struct grep_opt *opt)
 	 * A classic recursive descent parser would do.
 	 */
 	p = opt->pattern_list;
-	opt->pattern_expression = compile_pattern_expr(&p);
+	if (p)
+		opt->pattern_expression = compile_pattern_expr(&p);
 	if (p)
 		die("incomplete pattern expression: %s", p->pattern);
 }
-- 
1.6.2.22.gc2ac
Next: Junio C Hamano
Message 1 of 3 in “git log: avoid segfault with --all-match”
  1. git log: avoid segfault with --all-matchMichele Ballabio, Mar 18, 2009
  2. Junio C HamanoMar 18, 2009
  3. git log: avoid segfault with --all-matchMichele Ballabio, Mar 18, 2009

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.