From: Timo Sirainen Date: Thu, 15 Jun 2017 09:46:47 +0000 (+0300) Subject: imap-login: Fix storing ID NIL values into client_id X-Git-Tag: 2.3.0.rc1~1405 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ed26469c3b0d314c7eee1461de8b8d89e1c2010;p=thirdparty%2Fdovecot%2Fcore.git imap-login: Fix storing ID NIL values into client_id --- diff --git a/src/imap-login/imap-login-client.c b/src/imap-login/imap-login-client.c index 317113bfb4..15e0539e7f 100644 --- a/src/imap-login/imap-login-client.c +++ b/src/imap-login/imap-login-client.c @@ -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); }