Re: [PATCH] mm/memfd: replace strcpy() by strscpy()

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

 



Thanks for your suggestions. I just thought both of them are better than the deprecated strcpy().
Should I resubmit the patch after making changes or just leave it as it originally is?

Matthew Wilcox <willy@xxxxxxxxxxxxx> 于2021年1月24日周日 下午12:08写道:
On Sun, Jan 24, 2021 at 10:23:37AM +0800, Stephen Zhang wrote:
> -     strcpy(name, MFD_NAME_PREFIX);
> +     strscpy(name, MFD_NAME_PREFIX, len + MFD_NAME_PREFIX_LEN);

This is silly.  Use memcpy() if you must remove strcpy.

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux