summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Tyagi <pranav.tyagi03@gmail.com>2025-06-17 18:44:46 +0530
committerCarlos Maiolino <cem@kernel.org>2025-07-08 11:50:09 +0200
commitf2eb2796b95118b877b63d9fcd3459e70494a498 (patch)
treeb442704fc4e45a8c07a7a673f86caf3e86d9e668
parent9e9b46672b1daac814b384286c21fb8332a87392 (diff)
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 <pranav.tyagi03@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r--fs/xfs/xfs_xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 0f641a9091ec..ac5cecec9aa1 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';