From: Timo Sirainen Date: Thu, 14 May 2015 18:44:50 +0000 (+0300) Subject: lib-imap: Fixed crash in IDLE for non-TCP connections. X-Git-Tag: 2.2.18~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4aeb50a8311a86fd8e5d3bb71d56f2e3094f19df;p=thirdparty%2Fdovecot%2Fcore.git lib-imap: Fixed crash in IDLE for non-TCP connections. --- diff --git a/src/lib-imap/imap-keepalive.c b/src/lib-imap/imap-keepalive.c index 4424b53dee..3827081c6c 100644 --- a/src/lib-imap/imap-keepalive.c +++ b/src/lib-imap/imap-keepalive.c @@ -42,7 +42,7 @@ imap_keepalive_interval_msecs(const char *username, const struct ip_addr *ip, { unsigned int client_hash; - client_hash = imap_remote_ip_is_usable(ip) ? + client_hash = ip != NULL && imap_remote_ip_is_usable(ip) ? net_ip_hash(ip) : crc32_str(username); interval_secs -= (time(NULL) + client_hash) % interval_secs; return interval_secs * 1000;