mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
kernfs: Replace strcpy(s, "../") with memcpy(s, "../", 4)
The code has already checked there is enough room. Use memcpy() to avoid compiler warnings from possibly unbounded strcpy(). Signed-off-by: David Laight <david.laight.linux@gmail.com> Link: https://patch.msgid.link/20260606202633.5018-6-david.laight.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d996995a0f
commit
06553566a8
|
|
@ -73,7 +73,7 @@ static int kernfs_get_target_path(struct kernfs_node *parent,
|
|||
if ((s - path) + 3 >= PATH_MAX)
|
||||
return -ENAMETOOLONG;
|
||||
|
||||
strcpy(s, "../");
|
||||
memcpy(s, "../", 4);
|
||||
s += 3;
|
||||
base = kernfs_parent(base);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user