[TUHS] buffer overflow (Re: Happy birthday Morris worm

Arthur Krewat krewat at kilonet.net
Wed Nov 13 09:27:02 AEST 2019


On 11/12/2019 6:22 PM, Warner Losh wrote:
> strncpy has two issues. First, it doesn't guarantee NUL termination. 
> Second, it always writes N bytes. It's for a fixed width data field, 
> not a variable length string whose buffer size is known. strlcpy is 
> much better, but still has some issues...
Maybe he meant strcpy_s()


More information about the TUHS mailing list