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>
This commit is contained in:
Pranav Tyagi 2025-06-17 18:44:46 +05:30 committed by Carlos Maiolino
parent 9e9b46672b
commit f2eb2796b9
1 changed files with 1 additions and 1 deletions

View File

@ -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';