On Sat, Jul 12, 2025 at 02:12:48PM -0400, Theodore Ts'o wrote:
> The strcpy() function is considered dangerous and eeeevil by people
> who are using sophisticated code analysis tools such as "grep".  This
> is true even when a quick inspection would show that the source is a
> constant string ("." or "..") and the destination is a fixed array
> which is guaranteed to have enough space.  Make the "grep" code
> analysis tool happy by using memcpy() isstead of strcpy().  :-)

Why simple 2-arg strscpy() can't be used?

...

> -                     strcpy(fake.name, ".");
> +                     memcpy(fake.name, ".", 2);

s/strcpy/strscpy/

-- 
With Best Regards,
Andy Shevchenko



Reply via email to