Skip to content

Commit f2eb279

Browse files
Pranav Tyagicmaiolino
authored andcommitted
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 9e9b466 commit f2eb279

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ __xfs_xattr_put_listent(
243243
offset = context->buffer + context->count;
244244
memcpy(offset, prefix, prefix_len);
245245
offset += prefix_len;
246-
strncpy(offset, (char *)name, namelen); /* real name */
246+
memcpy(offset, (char *)name, namelen); /* real name */
247247
offset += namelen;
248248
*offset = '\0';
249249

0 commit comments

Comments
 (0)