]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-login: Fix storing ID NIL values into client_id
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 15 Jun 2017 09:46:47 +0000 (12:46 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 15 Jun 2017 09:46:47 +0000 (12:46 +0300)
src/imap-login/imap-login-client.c

index 317113bfb43832e08a17495b1d927a8700e9cff2..15e0539e7fd6c43e21a0bf38b386d6768fdb59a8 100644 (file)
@@ -222,12 +222,15 @@ static void cmd_id_handle_keyvalue(struct imap_client *client,
        size_t kvlen = strlen(key) + 2 + 1 +
                       (value == NULL ? 3 : strlen(value)) + 2;
 
-       if (value == NULL) {
-               /* do not try to process NIL value */
-               client_id_str = FALSE;
-       } else if (client->common.trusted && !client->id_logged) {
-               client_id_str = !client_update_info(client, key, value);
-               i_assert(client_id_str == !client_id_reserved_word(key));
+       if (client->common.trusted && !client->id_logged) {
+               if (value == NULL) {
+                       /* do not try to process NIL values as client-info,
+                          but store them for non-reserved keys */
+                       client_id_str = !client_id_reserved_word(key);
+               } else {
+                       client_id_str = !client_update_info(client, key, value);
+                       i_assert(client_id_str == !client_id_reserved_word(key));
+               }
        } else {
                client_id_str = !client_id_reserved_word(key);
        }