Re: [PATCH 11/20] hwmon: Manual replacement of the deprecated strlcpy() with return values

2021-02-28 Thread Joe Perches
On Mon, 2021-02-22 at 07:46 -0800, Guenter Roeck wrote: > On 2/22/21 7:12 AM, Romain Perier wrote: > > The strlcpy() reads the entire source buffer first, it is dangerous if > > the source buffer lenght is unbounded or possibility non NULL-terminated. > > length > > > It can lead to linear read

Re: [PATCH 11/20] hwmon: Manual replacement of the deprecated strlcpy() with return values

2021-02-22 Thread Guenter Roeck
On 2/22/21 7:12 AM, Romain Perier wrote: > The strlcpy() reads the entire source buffer first, it is dangerous if > the source buffer lenght is unbounded or possibility non NULL-terminated. length > It can lead to linear read overflows, crashes, etc... > Not here. This description is

[PATCH 11/20] hwmon: Manual replacement of the deprecated strlcpy() with return values

2021-02-22 Thread Romain Perier
The strlcpy() reads the entire source buffer first, it is dangerous if the source buffer lenght is unbounded or possibility non NULL-terminated. It can lead to linear read overflows, crashes, etc... As recommended in the deprecated interfaces [1], it should be replaced by strscpy. This commit