From: Michele Ballabio <barra_cuda@katamail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] git log: avoid segfault with --all-match
Date: Wed, 18 Mar 2009 19:06:16 +0100 [thread overview]
Message-ID: <1237399576-27323-1-git-send-email-barra_cuda@katamail.com> (raw)
Avoid a segfault when the command
git log --all-match
was issued.
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
---
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
next reply other threads:[~2009-03-18 17:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 18:06 Michele Ballabio [this message]
2009-03-18 18:33 ` [PATCH] git log: avoid segfault with --all-match Junio C Hamano
2009-03-18 20:53 ` [PATCH v2] " Michele Ballabio
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=1237399576-27323-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).