aboutsummaryrefslogtreecommitdiffhomepage
path: root/util
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2013-01-07 16:20:40 -0500
committerGravatar David Bremner <bremner@debian.org>2013-01-07 20:55:21 -0400
commitb4b22d37144c7820b435cea500fa4cfd1088b191 (patch)
tree44fc04374d3d4877f8e9bae23f4146e72e1fc4bf /util
parentbd829fde9640cf23482b3f1dfe2007ef38f2b24a (diff)
string-util: Disallow empty prefixes in parse_boolean_term
Xapian doesn't consider ":abc" to be a prefixed term. This makes parse_boolean_term similarly reject queries with an empty prefix.
Diffstat (limited to 'util')
-rw-r--r--util/string-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/string-util.c b/util/string-util.c
index aba9aa83..a5622d7a 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) {