]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap: Fixed crash in IDLE for non-TCP connections.
authorTimo Sirainen <tss@iki.fi>
Thu, 14 May 2015 18:44:50 +0000 (21:44 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 14 May 2015 18:44:50 +0000 (21:44 +0300)
src/lib-imap/imap-keepalive.c

index 4424b53dee16fc0f58866c96ac3c6a3d19e775b6..3827081c6c58ba9aaac800db89ed6241c4af4234 100644 (file)
@@ -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;