[dovecot/core] 5985a8: imapc: Fix potential assert-crash when selecting e...

GitHub noreply at github.com
Mon Jun 25 13:00:09 EEST 2018


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: 5985a8b02df58c90fdb155dbed14fe879d2ae7d6
      https://github.com/dovecot/core/commit/5985a8b02df58c90fdb155dbed14fe879d2ae7d6
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2018-06-25 (Mon, 25 Jun 2018)

  Changed paths:
    M src/lib-storage/index/imapc/imapc-mailbox.c
    M src/lib-storage/index/imapc/imapc-storage.c
    M src/lib-storage/index/imapc/imapc-storage.h

  Log Message:
  -----------
  imapc: Fix potential assert-crash when selecting empty mailbox

imapc_mailbox_fetch_state_finish() should have been expunging all the mails,
but it didn't happen since UIDNEXT wasn't received yet at the time EXISTS
was sent, so sync_uid_next was always 0 when checking it. Fix this by
calling imapc_mailbox_fetch_state_finish() only after SELECT/EXAMINE tagged
reply is received.

This practically happened only when index files were used. It could also
happen without index files, if the session had received new mails after
opening the mailbox, then getting disconnected and before reconnect was
finished all the mails were externally expunged.

Fixes:
Panic: file imapc-sync.c: line 328 (imapc_initial_sync_check): assertion failed: (mail_index_is_expunged(view, lseq) || seq_range_exists(&ctx->mbox->delayed_expunged_uids, luid))


  Commit: 7d8809625a6074c4c950a37e6b4818abc3653635
      https://github.com/dovecot/core/commit/7d8809625a6074c4c950a37e6b4818abc3653635
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2018-06-25 (Mon, 25 Jun 2018)

  Changed paths:
    M src/lib-storage/index/imapc/imapc-mailbox.c
    M src/lib-storage/index/imapc/imapc-storage.c

  Log Message:
  -----------
  imapc: Move selected=TRUE to imap_mailbox_select_finish()

Minor code deduplication cleanup.


Compare: https://github.com/dovecot/core/compare/d8ac15c798ea...7d8809625a60
      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the dovecot-cvs mailing list