# HG changeset patch # User Timo Sirainen # Date 1313357418 -10800 # Node ID 68c7faa869f84100a18ffefe3bdb2e1faf770feb # Parent 5aee3be80d104b69f886f3c496e31bc0708bb050 mbox: Fixed crashing with pop3_lock_session=yes diff -r 5aee3be80d10 -r 68c7faa869f8 src/lib-storage/index/mbox/mbox-lock.c --- a/src/lib-storage/index/mbox/mbox-lock.c Sun Aug 14 23:39:10 2011 +0300 +++ b/src/lib-storage/index/mbox/mbox-lock.c Mon Aug 15 00:30:18 2011 +0300 @@ -784,8 +784,10 @@ i_assert(lock_type == F_RDLCK || lock_type == F_WRLCK); i_assert(lock_type == F_RDLCK || mbox->mbox_lock_type != F_RDLCK); - /* mbox must be locked before index */ - i_assert(mbox->box.index->lock_type != F_WRLCK); + /* mbox must be locked before index (the NULL check is for + MAILBOX_FLAG_KEEP_LOCKED) */ + i_assert(mbox->box.index == NULL || + mbox->box.index->lock_type != F_WRLCK); if (mbox->mbox_lock_type == F_UNLCK) { ret = mbox_update_locking(mbox, lock_type, &fcntl_locked);