]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts-lucene: Crashfix for handling header searches with stop words (etc).
authorTimo Sirainen <tss@iki.fi>
Wed, 10 Aug 2011 10:46:31 +0000 (13:46 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 10 Aug 2011 10:46:31 +0000 (13:46 +0300)
src/plugins/fts-lucene/lucene-wrapper.cc

index cf40c5ee46d8cda90e46b6588f65281f9d4c4b30..1e2de7921dc05e7b947e3749d68f9bf27cf1e3fe 100644 (file)
@@ -767,6 +767,11 @@ lucene_add_maybe_query(struct lucene_index *index, BooleanQuery &query,
                return false;
        }
 
+       if (q == NULL) {
+               /* couldn't handle this search after all (e.g. trying to search
+                  a stop word) */
+               return false;
+       }
        if (!and_args)
                query.add(q, true, BooleanClause::SHOULD);
        else if (!arg->match_not)