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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid a segfault when the command

	git log --all-match

was issued.

Signed-off-by: Michele Ballabio <barra_cuda@xxxxxxxxxxxx>
---

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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux