git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michele Ballabio <barra_cuda@katamail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org
Subject: [PATCH v2] git log: avoid segfault with --all-match
Date: Wed, 18 Mar 2009 21:53:27 +0100	[thread overview]
Message-ID: <1237409607-4169-1-git-send-email-barra_cuda@katamail.com> (raw)
In-Reply-To: <7vbpryfzpb.fsf@gitster.siamese.dyndns.org>

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>
---
 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

      reply	other threads:[~2009-03-18 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18 18:06 [PATCH] git log: avoid segfault with --all-match Michele Ballabio
2009-03-18 18:33 ` Junio C Hamano
2009-03-18 20:53   ` Michele Ballabio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237409607-4169-1-git-send-email-barra_cuda@katamail.com \
    --to=barra_cuda@katamail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).