Re: unsafe strlcpy
Maxime Villard <[email protected]> Sat, 15 Feb 2020 13:36:52 +0100
| Newsgroups | gmane.os.netbsd.devel.security |
|---|---|
| Message-ID | <[email protected]> |
First of all: Le 08/02/2020 à 15:54, Maxime Villard a écrit : > [I am not subscribed to this list, so if you want to answer, make sure to CC me] Then: > Neither strlcpy nor copystr is safe copystr stops reading both buffers if the limit (size) is reached, therefore it would have been safe to use in the cases I mentioned, contrary to strlcpy. > in netbsd32_ioctl it should just be replaced with memcpy(). Actually, here, yes. > The correct way is to safely parse the input, e.g. with strnvisx. Yeah, but my point was, more importantly, the printfs should be under debug only or at the very least rate-limited. Maxime