mirror of https://github.com/torvalds/linux.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 <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:
parent
9e9b46672b
commit
f2eb2796b9
|
|
@ -243,7 +243,7 @@ __xfs_xattr_put_listent(
|
||||||
offset = context->buffer + context->count;
|
offset = context->buffer + context->count;
|
||||||
memcpy(offset, prefix, prefix_len);
|
memcpy(offset, prefix, prefix_len);
|
||||||
offset += prefix_len;
|
offset += prefix_len;
|
||||||
strncpy(offset, (char *)name, namelen); /* real name */
|
memcpy(offset, (char *)name, namelen); /* real name */
|
||||||
offset += namelen;
|
offset += namelen;
|
||||||
*offset = '\0';
|
*offset = '\0';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue