dovecot-2.1: fts: Fixed a crash if virtual mailbox search couldn...

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 1 22:43:55 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/323d6ce62567
changeset: 14655:323d6ce62567
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 01 22:43:45 2012 +0300
description:
fts: Fixed a crash if virtual mailbox search couldn't be optimized by backend.

diffstat:

 src/plugins/fts/fts-api.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r d499f6d0ca68 -r 323d6ce62567 src/plugins/fts/fts-api.c
--- a/src/plugins/fts/fts-api.c	Wed Aug 01 22:39:57 2012 +0300
+++ b/src/plugins/fts/fts-api.c	Wed Aug 01 22:43:45 2012 +0300
@@ -323,8 +323,14 @@
 	i_assert(boxes[0] != NULL);
 
 	if (backend->v.lookup_multi != NULL) {
-		return backend->v.lookup_multi(backend, boxes, args,
-					       and_args, result);
+		if (backend->v.lookup_multi(backend, boxes, args,
+					    and_args, result) < 0)
+			return -1;
+		if (result->box_results == NULL) {
+			result->box_results = p_new(result->pool,
+						    struct fts_result, 1);
+		}
+		return 0;
 	}
 
 	for (i = 0; boxes[i] != NULL; i++) ;


More information about the dovecot-cvs mailing list