changeset 18577:162668a63045

fts: Don't crash if search arg string expands to empty token list.
author Timo Sirainen <tss@iki.fi>
date Sat, 09 May 2015 13:30:41 +0300
parents 3bcd04bf5635
children eff53aa9cb58
files src/plugins/fts/fts-search-args.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts/fts-search-args.c	Sat May 09 13:20:29 2015 +0300
+++ b/src/plugins/fts/fts-search-args.c	Sat May 09 13:30:41 2015 +0300
@@ -128,6 +128,12 @@
 							   token) < 0)
 			return -1;
 	}
+
+	if (and_arg->value.subargs == NULL) {
+		/* we couldn't parse any tokens from the input */
+		and_arg->type = SEARCH_ALL;
+		and_arg->match_not = !and_arg->match_not;
+	}
 	*argp = and_arg;
 	return 0;
 }