Skip to content

Commit ba150a3

Browse files
chungagitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 092927c commit ba150a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

grep.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ void compile_grep_patterns(struct grep_opt *opt)
192192
* A classic recursive descent parser would do.
193193
*/
194194
p = opt->pattern_list;
195-
opt->pattern_expression = compile_pattern_expr(&p);
195+
if (p)
196+
opt->pattern_expression = compile_pattern_expr(&p);
196197
if (p)
197198
die("incomplete pattern expression: %s", p->pattern);
198199
}

0 commit comments

Comments
 (0)