Re: unsafe strlcpy

[email protected] (Michael van Elst) Sun, 9 Feb 2020 06:42:12 -0000 (UTC)
Newsgroups gmane.os.netbsd.devel.security
Organization Serpens User Group
Message-ID <[email protected]>
[email protected] (Maxime Villard) writes:

>I think that strlcpy has a bad design and should be replaced by the safer
>copystr.

Neither strlcpy nor copystr is safe, and in netbsd32_ioctl it should just
be replaced with memcpy().

>In PPPoE I think we should drop the string stuff, calling printf is already a
>bad idea anyway.

The correct way is to safely parse the input, e.g. with strnvisx.

-- 
-- 
                                Michael van Elst
Internet: [email protected]
                                "A potential Snark may lurk in every tree."