# HG changeset patch # User Timo Sirainen # Date 1247688549 14400 # Node ID 2bb46e1c0f5357a14ac01f7a5965e96bf3ad1f1e # Parent 6a54f2c41cec344af5a2d89c2e39410b75559109 IMAP: When QRESYNC is enabled, don't crash when a new mail is received while IDLEing. diff -r 6a54f2c41cec -r 2bb46e1c0f53 src/imap/imap-sync.c --- a/src/imap/imap-sync.c Wed Jul 15 12:59:17 2009 -0400 +++ b/src/imap/imap-sync.c Wed Jul 15 16:09:09 2009 -0400 @@ -180,7 +180,7 @@ } else if (!status->sync_delayed_expunges && status->highest_modseq > client->sync_last_full_modseq && status->highest_modseq > client->highest_fetch_modseq) { - /* we've probably send some VANISHED or EXISTS replies which + /* we've probably sent some VANISHED or EXISTS replies which increased the highest-modseq. notify the client about this. */ send_modseq = status->highest_modseq; @@ -188,7 +188,8 @@ if (send_modseq == 0) { /* no sending */ - } else if (strncmp(sync_cmd->sync->tagline, "OK ", 3) == 0 && + } else if (sync_cmd->sync != NULL && /* IDLE doesn't have ->sync */ + strncmp(sync_cmd->sync->tagline, "OK ", 3) == 0 && sync_cmd->sync->tagline[3] != '[') { /* modify the tagged reply directly */ sync_cmd->sync->tagline = p_strdup_printf(sync_cmd->pool,