aboutsummaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorMichele Ballabio <barra_cuda@katamail.com>2009-03-18 21:53:27 +0100
committerJunio C Hamano <gitster@pobox.com>2009-03-18 19:10:40 -0700
commitba150a3fdce48e4b973db6e153e6b3ffb28a0cea (patch)
treef893b4b92eabb13812e1553093a5effebe4ba554 /grep.c
parent092927c1b01632d030d9d746d36ad6dd02bc3967 (diff)
downloadgit-ba150a3fdce48e4b973db6e153e6b3ffb28a0cea.tar.gz
git-ba150a3fdce48e4b973db6e153e6b3ffb28a0cea.tar.xz
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>
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c3
1 files changed, 2 insertions, 1 deletions
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);
}