From: Aki Tuomi Date: Tue, 25 Oct 2016 07:29:50 +0000 (+0300) Subject: imap-login: Skip NIL value in ID handler X-Git-Tag: 2.2.27~308 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=769240367c7c2d4bbc59162da8f6f5a8e92feb6d;p=thirdparty%2Fdovecot%2Fcore.git imap-login: Skip NIL value in ID handler NIL value can cause hard crash, depending what the key is. For x-proxy-ttl, NIL will crash on any system, x-originating-ip will crash on some nss versions (e.g. centos 6.7). Migitating factor here is that the NIL value is only accepted from trusted network. --- diff --git a/src/imap-login/imap-login-client.c b/src/imap-login/imap-login-client.c index b1a6d67a7a..eb89f09144 100644 --- a/src/imap-login/imap-login-client.c +++ b/src/imap-login/imap-login-client.c @@ -150,6 +150,9 @@ static void client_update_info(struct imap_client *client, const char *key, const char *value) { + /* do not try to process NIL value */ + if (value == NULL) + return; if (strcasecmp(key, "x-originating-ip") == 0) { (void)net_addr2ip(value, &client->common.ip); } else if (strcasecmp(key, "x-originating-port") == 0) {