Mercurial > dovecot > core-2.2
changeset 21426:e231610ca949
lib-storage: Fix mailbox's vsize header check for mailboxes not in dovecot.list.index
If mailbox wasn't yet in the dovecot.list.index, mailbox_list_index_status()
for it returns FALSE and doesn't initialize the status. In some situations this
may have caused a non-empty mailbox's vsize to be returned as 0.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 20 Jan 2017 14:46:30 +0200 |
parents | 70083e131e22 |
children | 658d7731b125 |
files | src/lib-storage/list/mailbox-list-index-status.c |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-index-status.c Tue Jan 10 02:12:25 2017 +0100 +++ b/src/lib-storage/list/mailbox-list-index-status.c Fri Jan 20 14:46:30 2017 +0200 @@ -264,11 +264,10 @@ ret = mailbox_list_index_status(box->list, view, seq, STATUS_MESSAGES | STATUS_UIDNEXT, &status, NULL, &vsize) ? 1 : 0; - if (status.messages == 0 && status.uidnext > 0) { + if (ret > 0 && status.messages == 0 && status.uidnext > 0) { /* mailbox is empty. its size has to be zero, regardless of what the vsize header says. */ vsize.vsize = 0; - ret = 1; } else if (ret > 0 && (vsize.highest_uid + 1 != status.uidnext || vsize.message_count != status.messages)) { /* out of date vsize info */