Re: [PATCH net-next v4] tipc: replace deprecated strcpy with strscpy in tipc_bearer_get_name()
From: Ratheesh Kannoth
Date: Thu Sep 03 2026 - 08:27:46 EST
On 2026-09-02 at 11:00:43, Ajith P V (ajithpv.linux@xxxxxxxxx) wrote:
> @@ -209,7 +211,9 @@ int tipc_bearer_get_name(struct net *net, char *name, u32 bearer_id)
> if (!b)
> return -EINVAL;
>
> - strcpy(name, b->name);
> + ret = strscpy(name, b->name, len);
> + if (ret < 0)
> + return ret; /* Returns -E2BIG if destination buffer is too small */
nit: please remove the comment.
> return 0;
Reviewed-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>