Re: [PATCH] initramfs: Replace strcpy() with strscpy() in find_link()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Sep 12, 2025 at 08:47:24AM +0200, Thorsten Blum wrote:
> strcpy() is deprecated; use strscpy() instead.
> 
> Link: https://github.com/KSPP/linux/issues/88
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>

Reviewed-by: Justin Stitt <justinstitt@xxxxxxxxxx>

> ---
>  init/initramfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/init/initramfs.c b/init/initramfs.c
> index 097673b97784..6745e3fbc7ab 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -108,7 +108,7 @@ static char __init *find_link(int major, int minor, int ino,
>  	q->minor = minor;
>  	q->ino = ino;
>  	q->mode = mode;
> -	strcpy(q->name, name);
> +	strscpy(q->name, name);
>  	q->next = NULL;
>  	*p = q;
>  	hardlink_seen = true;
> -- 
> 2.51.0
> 
>

Thanks
Justin




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux