From ba150a3fdce48e4b973db6e153e6b3ffb28a0cea Mon Sep 17 00:00:00 2001 From: Michele Ballabio Date: Wed, 18 Mar 2009 21:53:27 +0100 Subject: [PATCH] git log: avoid segfault with --all-match Avoid a segfault when the command git log --all-match was issued, by ignoring the option. Signed-off-by: Michele Ballabio Signed-off-by: Junio C Hamano --- grep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grep.c b/grep.c index be99b3416..f3a27d7d6 100644 --- a/grep.c +++ b/grep.c @@ -192,7 +192,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); } -- 2.26.2