ecryptfs: Replace memcpy + NUL termination in ecryptfs_new_file_context
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 19 Dec 2025 21:32:33 +0000 (22:32 +0100)
committerTyler Hicks <code@tyhicks.com>
Tue, 23 Dec 2025 21:23:23 +0000 (15:23 -0600)
commite8fb5ec8934312df0a8f28b5514733acdf7ba722
treeae60e1645d3871242e055382733314fdc2b9fa1a
parent0529a804095b22bf4fe8502d1a1eb09a25a5b954
ecryptfs: Replace memcpy + NUL termination in ecryptfs_new_file_context

Use strscpy() to copy the NUL-terminated '->global_default_cipher_name'
to the destination buffer instead of using memcpy() followed by a manual
NUL termination. Remove the now-unused local variable 'cipher_name_len'.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Tyler Hicks <code@tyhicks.com>
fs/ecryptfs/crypto.c