Thread (16 messages) 16 messages, 6 authors, 2021-08-08

Re: [PATCH] drivers/input: Remove all strcpy() uses in favor of strscpy()

flat view

From: Joe Perches <joe@perches.com>
Date: 2021-08-07 15:17:49
Also in: linux-hardening, lkml

On Sat, 2021-08-07 at 16:02 +0200, Len Baker wrote:
On Sun, Aug 01, 2021 at 09:44:33AM -0700, Kees Cook wrote:
[]
quoted
One thing is clear: replacing strlcpy() with strscpy() is probably the
easiest and best first step to cleaning up the proliferation of str*()
functions.
Thanks for all this info. I will work on it (clean up the proliferation
of str*() functions).
btw:

It's not possible to sed as the return value is different,
but here is a cocci script that converts strlcpy to strscpy
when the return value is unused.

    @@
    expression e1, e2, e3;
    @@
    
    -       strlcpy(
    +       strscpy(
            e1, e2, e3);

This cocci script was used on sound/ awhile back.
see commit 75b1a8f9d62e.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help