From: Aki Tuomi Date: Mon, 10 Aug 2020 16:54:51 +0000 (+0300) Subject: auth: auth-cache - Data is not 4 bytes but variable sized X-Git-Tag: 2.3.13~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddf34a7a7c38938401052f83f9381d5400bdcff5;p=thirdparty%2Fdovecot%2Fcore.git auth: auth-cache - Data is not 4 bytes but variable sized --- diff --git a/src/auth/auth-cache.c b/src/auth/auth-cache.c index 2bebd33d7a..9a7b7da5ad 100644 --- a/src/auth/auth-cache.c +++ b/src/auth/auth-cache.c @@ -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) diff --git a/src/auth/auth-cache.h b/src/auth/auth-cache.h index 5cd3f8d4b5..ab02fe57c0 100644 --- a/src/auth/auth-cache.h +++ b/src/auth/auth-cache.h @@ -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;