dovecot-2.0: IMAP: When QRESYNC is enabled, don't crash when a n...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 15 23:10:58 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/4f9267f13944
changeset: 9633:4f9267f13944
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 15 16:09:09 2009 -0400
description:
IMAP: When QRESYNC is enabled, don't crash when a new mail is received while IDLEing.

diffstat:

1 file changed, 3 insertions(+), 2 deletions(-)
src/imap/imap-sync.c |    5 +++--

diffs (22 lines):

diff -r 85064a01ddfd -r 4f9267f13944 src/imap/imap-sync.c
--- a/src/imap/imap-sync.c	Wed Jul 15 14:13:02 2009 -0400
+++ b/src/imap/imap-sync.c	Wed Jul 15 16:09:09 2009 -0400
@@ -180,7 +180,7 @@ imap_sync_send_highestmodseq(struct imap
 	} 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 @@ imap_sync_send_highestmodseq(struct imap
 
 	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,


More information about the dovecot-cvs mailing list