From: Jani Nikula <jani@nikula.org>
To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
Subject: Re: [PATCH] string-util: Disallow empty prefixes in parse_boolean_term
Date: Tue, 08 Jan 2013 00:12:43 +0200 [thread overview]
Message-ID: <87ip78ej6s.fsf@nikula.org> (raw)
In-Reply-To: <1357593640-32122-1-git-send-email-amdragon@mit.edu>
On Mon, 07 Jan 2013, Austin Clements <amdragon@MIT.EDU> wrote:
> Xapian doesn't consider ":abc" to be a prefixed term. This makes
> parse_boolean_term similarly reject queries with an empty prefix.
LGTM,
Jani.
> ---
> util/string-util.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/string-util.c b/util/string-util.c
> index aba9aa8..a5622d7 100644
> --- a/util/string-util.c
> +++ b/util/string-util.c
> @@ -127,7 +127,7 @@ parse_boolean_term (void *ctx, const char *str,
> /* Parse prefix */
> str = skip_space (str);
> const char *pos = strchr (str, ':');
> - if (! pos)
> + if (! pos || pos == str)
> goto FAIL;
> *prefix_out = talloc_strndup (ctx, str, pos - str);
> if (! *prefix_out) {
> --
> 1.7.10.4
next prev parent reply other threads:[~2013-01-07 22:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 21:20 [PATCH] string-util: Disallow empty prefixes in parse_boolean_term Austin Clements
2013-01-07 22:12 ` Jani Nikula [this message]
2013-01-08 0:37 ` David Bremner
2013-01-08 0:58 ` David Bremner
2013-01-08 3:04 ` David Bremner
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ip78ej6s.fsf@nikula.org \
--to=jani@nikula.org \
--cc=amdragon@MIT.EDU \
--cc=notmuch@notmuchmail.org \
/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.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).