[dovecot-cvs] dovecot: If mail_set_uid() returns failure, don't crash.

dovecot at dovecot.org dovecot at dovecot.org
Tue May 22 21:24:20 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/119ffb997eda
changeset: 5648:119ffb997eda
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 22 21:24:15 2007 +0300
description:
If mail_set_uid() returns failure, don't crash.

diffstat:

1 file changed, 5 insertions(+), 3 deletions(-)
src/plugins/quota/quota-storage.c |    8 +++++---

diffs (18 lines):

diff -r 6c61d716274b -r 119ffb997eda src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c	Tue May 22 20:40:13 2007 +0300
+++ b/src/plugins/quota/quota-storage.c	Tue May 22 21:24:15 2007 +0300
@@ -319,9 +319,11 @@ static void quota_mailbox_sync_notify(st
 			mail_alloc(qbox->expunge_trans,
 				   MAIL_FETCH_PHYSICAL_SIZE, NULL);
 	}
-	mail_set_uid(qbox->expunge_qt->tmp_mail, uid);
-
-	size = mail_get_physical_size(qbox->expunge_qt->tmp_mail);
+	if (mail_set_uid(qbox->expunge_qt->tmp_mail, uid) <= 0)
+		size = (uoff_t)-1;
+	else
+		size = mail_get_physical_size(qbox->expunge_qt->tmp_mail);
+
 	if (size != (uoff_t)-1)
 		quota_free_bytes(qbox->expunge_qt, size);
 	else {


More information about the dovecot-cvs mailing list