]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-login: Skip NIL value in ID handler
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 25 Oct 2016 07:29:50 +0000 (10:29 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Oct 2016 18:01:22 +0000 (21:01 +0300)
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.

src/imap-login/imap-login-client.c

index b1a6d67a7a7316b30c5a1987e29545c126ce9564..eb89f091440db8e85300e9a10ffd44cf08ec0d90 100644 (file)
@@ -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) {