From: Pranav Tyagi Date: Tue, 17 Jun 2025 13:14:46 +0000 (+0530) Subject: xfs: replace strncpy with memcpy in xattr listing X-Git-Tag: v6.16-rc7~35^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2eb2796b95118b877b63d9fcd3459e70494a498;p=thirdparty%2Fkernel%2Flinux.git xfs: replace strncpy with memcpy in xattr listing Use memcpy() in place of strncpy() in __xfs_xattr_put_listent(). The length is known and a null byte is added manually. No functional change intended. Signed-off-by: Pranav Tyagi Reviewed-by: Darrick J. Wong Reviewed-by: Carlos Maiolino Signed-off-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 0f641a9091ecb..ac5cecec9aa14 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c @@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count; memcpy(offset, prefix, prefix_len); offset += prefix_len; - strncpy(offset, (char *)name, namelen); /* real name */ + memcpy(offset, (char *)name, namelen); /* real name */ offset += namelen; *offset = '\0';