]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli:auth: fix BURN_DATA_SIZE on array-decayed pointer parameter
authorAndreas Schneider <asn@samba.org>
Wed, 20 May 2026 14:22:43 +0000 (16:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 21 May 2026 17:25:33 +0000 (17:25 +0000)
_encode_pwd_buffer_from_str() declares `buf` as uint8_t buf[N],
which decays to a pointer. BURN_DATA_SIZE(buf, N) expands to
memset_explicit(&buf, 0, N), taking the address of the pointer
variable (8 bytes) rather than the buffer itself, triggering a
GCC -Wstringop-overflow error.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=16006

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/auth/smbencrypt.c

index 0f1f320afe5f5fdedca5a87d2eb27eea759bfad7..bdb41051a36f1fdf66bf7651ecf28fed383b5beb 100644 (file)
@@ -1426,7 +1426,7 @@ static ssize_t _encode_pwd_buffer_from_str(uint8_t buf[PASSWORD_BUFFER_LEN],
                                 PASSWORD_BUFFER_LEN,
                                 string_flags);
        if (new_pw_len < 0) {
-               BURN_DATA_SIZE(buf, PASSWORD_BUFFER_LEN);
+               BURN_PTR_SIZE(buf, PASSWORD_BUFFER_LEN);
                return -1;
        }