]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: Use snprintf in cifs_set_cifscreds
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 26 Feb 2026 22:15:22 +0000 (23:15 +0100)
committerSteve French <stfrench@microsoft.com>
Fri, 27 Feb 2026 16:19:54 +0000 (10:19 -0600)
commitf505a45776d149632e3bd0b87f0da1609607161a
treef8f9fded8f8049720141c9afd6d7d8396937821a
parent2f37dc436d4e61ff7ae0b0353cf91b8c10396e4d
smb: client: Use snprintf in cifs_set_cifscreds

Replace unbounded sprintf() calls with the safer snprintf(). Avoid using
magic numbers and use strlen() to calculate the key descriptor buffer
size. Save the size in a local variable and reuse it for the bounded
snprintf() calls. Remove CIFSCREDS_DESC_SIZE.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/connect.c