]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 16 Jun 2017 06:36:50 +0000 (09:36 +0300)
src/imap-login/imap-login-client.c

index a4b1957665f80ccf98491c34dfeba467a3534748..16999f2bb814711adb2b73bdc218132226308be0 100644 (file)
@@ -208,12 +208,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);
        }