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 <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michele Ballabio committed
Mar 18, 2009 at 21:53 UTC
ba150a3fdce48e4b973db6e153e6b3ffb28a0cea
1 file changed
+2
-1
grep.c
+2
-1
@@ -192,7 +192,8 @@ void compile_grep_patterns(struct grep_opt *opt)
192
* A classic recursive descent parser would do.
193
*/
194
p = opt->pattern_list;
195
- opt->pattern_expression = compile_pattern_expr(&p);
195
+ if (p)
196
+ opt->pattern_expression = compile_pattern_expr(&p);
197
if (p)
198
die("incomplete pattern expression: %s", p->pattern);
199
}