dovecot-2.0: mail-log: If saved uid isn't available, log an erro...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 4 17:51:52 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/e575fd47c3a5
changeset: 11472:e575fd47c3a5
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 04 15:51:47 2010 +0100
description:
mail-log: If saved uid isn't available, log an error instead of crashing.
This shouldn't happen, except when saving to virtual mailbox.

diffstat:

 src/plugins/mail-log/mail-log-plugin.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (24 lines):

diff -r 57723949babb -r e575fd47c3a5 src/plugins/mail-log/mail-log-plugin.c
--- a/src/plugins/mail-log/mail-log-plugin.c	Fri Jun 04 15:50:41 2010 +0100
+++ b/src/plugins/mail-log/mail-log-plugin.c	Fri Jun 04 15:51:47 2010 +0100
@@ -358,16 +358,16 @@
 	struct seq_range_iter iter;
 	unsigned int n = 0;
 	uint32_t uid;
-	bool ret;
 
 	seq_range_array_iter_init(&iter, &changes->saved_uids);
 	for (msg = ctx->messages; msg != NULL; msg = msg->next) {
 		if (msg->pretext == NULL) {
 			i_info("%s", msg->text);
 		} else {
-			ret = seq_range_array_iter_nth(&iter, n++, &uid);
-			i_assert(ret);
-			i_info("%s%u%s", msg->pretext, uid, msg->text);
+			if (seq_range_array_iter_nth(&iter, n++, &uid))
+				i_info("%s%u%s", msg->pretext, uid, msg->text);
+			else
+				i_info("%serror%s", msg->pretext, msg->text);
 		}
 	}
 	i_assert(!seq_range_array_iter_nth(&iter, n, &uid));


More information about the dovecot-cvs mailing list