Skip to content

Commit 12335f6

Browse files
meritissimo1gregkh
authored andcommitted
xfs: Replace strncpy with memcpy
[ Upstream commit 33ddc79 ] The changes modernizes the code by aligning it with current kernel best practices. It improves code clarity and consistency, as strncpy is deprecated as explained in Documentation/process/deprecated.rst. This change does not alter the functionality or introduce any behavioral changes. Suggested-by: Dave Chinner <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Marcelo Moreira <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]> Stable-dep-of: 678e1cc ("xfs: fix out of bounds memory read error in symlink repair") Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6d3275d commit 12335f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/scrub/symlink_repair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ xrep_symlink_salvage_inline(
185185
return 0;
186186

187187
nr = min(XFS_SYMLINK_MAXLEN, xfs_inode_data_fork_size(ip));
188-
strncpy(target_buf, ifp->if_data, nr);
188+
memcpy(target_buf, ifp->if_data, nr);
189189
return nr;
190190
}
191191

0 commit comments

Comments
 (0)