dovecot-2.1: fts: Fixed crash when searching virtual mailboxes a...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 20 18:46:21 EET 2013


details:   http://hg.dovecot.org/dovecot-2.1/rev/87a9eec10145
changeset: 14932:87a9eec10145
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 20 18:46:10 2013 +0200
description:
fts: Fixed crash when searching virtual mailboxes and fts backend without lookup_multi().
Patch by Mike Abbott / Apple

diffstat:

 src/plugins/fts/fts-api.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r a7928075f0fd -r 87a9eec10145 src/plugins/fts/fts-api.c
--- a/src/plugins/fts/fts-api.c	Mon Mar 04 15:53:42 2013 +0200
+++ b/src/plugins/fts/fts-api.c	Wed Mar 20 18:46:10 2013 +0200
@@ -337,8 +337,13 @@
 	result->box_results = p_new(result->pool, struct fts_result, i+1);
 
 	for (i = 0; boxes[i] != NULL; i++) {
+		struct fts_result *box_result = &result->box_results[i];
+
+		p_array_init(&box_result->definite_uids, result->pool, 32);
+		p_array_init(&box_result->maybe_uids, result->pool, 32);
+		p_array_init(&box_result->scores, result->pool, 32);
 		if (backend->v.lookup(backend, boxes[i], args,
-				      and_args, &result->box_results[i]) < 0)
+				      and_args, box_result) < 0)
 			return -1;
 	}
 	return 0;


More information about the dovecot-cvs mailing list