Re: [PATCH] of: replace deprecated strcpy() with strscpy()

From: Krzysztof Kozlowski
Date: Mon Jul 28 2025 - 01:24:08 EST


On Thu, Jul 24, 2025 at 09:33:41AM +0200, Miguel García wrote:
> @@ -84,7 +84,7 @@ static struct property * __init of_pdt_build_one_prop(phandle node, char *prev,
>
> p->name = (char *) (p + 1);
> if (special_name) {
> - strcpy(p->name, special_name);
> + strscpy(p->name, special_name, sizeof(p->name));

This was not ever tested and I don't think you understand how C pointers
work.

Please document here how exactly did you test this code path?

Best regards,
Krzysztof