Re: [PATCH 19/20] usbip: usbip_host: Manual replacement of the deprecated strlcpy() with return values

From
Sergei Shtylyov <hidden>
Date
2021-02-28 09:05:02
Also in
lkml
Reply to
Romain Perier, 2021-02-22
Hello!

On 22.02.2021 18:12, 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. Possibly?
It can lead to linear read overflows, crashes, etc...

As recommended in the deprecated interfaces [1], it should be replaced
by strscpy.

This commit replaces all calls to strlcpy that handle the return values
by the corresponding strscpy calls with new handling of the return
values (as it is quite different between the two functions).

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy

Signed-off-by: Romain Perier <romain.perier@gmail.com>
[...]

MBR, Sergei
Thread (6 messages) 6 messages, 3 authors, last reply 2021-02-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help