]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth-cache - Data is not 4 bytes but variable sized
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 10 Aug 2020 16:54:51 +0000 (19:54 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 11 Sep 2020 07:07:20 +0000 (07:07 +0000)
src/auth/auth-cache.c
src/auth/auth-cache.h

index 2bebd33d7a98cf50240a714bbc43692c53b88d70..9a7b7da5adbf4d2e571abddf99e72d1c831f2e4b 100644 (file)
@@ -440,8 +440,7 @@ void auth_cache_insert(struct auth_cache *cache, struct auth_request *request,
        key_len = strlen(key);
 
        data_size = key_len + 1 + value_len + 1;
-       alloc_size = sizeof(struct auth_cache_node) -
-               sizeof(node->data) + data_size;
+       alloc_size = sizeof(struct auth_cache_node) + data_size;
 
        /* make sure we have enough space */
        while (cache->size_left < alloc_size && cache->tail != NULL)
index 5cd3f8d4b59ebe28d38024ca769c580250c96b94..ab02fe57c06856791533f53d085717e31d840d1f 100644 (file)
@@ -10,7 +10,7 @@ struct auth_cache_node {
        /* TRUE if the user gave the correct password the last time. */
        bool last_success:1;
 
-       char data[4]; /* key \0 value \0 */
+       char data[]; /* key \0 value \0 */
 };
 
 struct auth_cache;