From: Timo Sirainen Date: Wed, 10 Aug 2011 10:46:31 +0000 (+0300) Subject: fts-lucene: Crashfix for handling header searches with stop words (etc). X-Git-Tag: 2.1.alpha1~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dc03b7bb2cc2b78bf66856bdfedfb1cae774c43b;p=thirdparty%2Fdovecot%2Fcore.git fts-lucene: Crashfix for handling header searches with stop words (etc). --- diff --git a/src/plugins/fts-lucene/lucene-wrapper.cc b/src/plugins/fts-lucene/lucene-wrapper.cc index cf40c5ee46..1e2de7921d 100644 --- a/src/plugins/fts-lucene/lucene-wrapper.cc +++ b/src/plugins/fts-lucene/lucene-wrapper.cc @@ -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)