Re:Git's list of banned C functions
by syncsynchalt on Thursday March 04, 2021 @06:01PM
(#26349741)
strncpy is a dangerous function because it doesn't nul terminate on overflow. The danger is that it's named misleadingly (str* functions otherwise always work in nul-terminated strings).
(strcpy is just banned because there's no bounds check, and they want to force use of strlcpy instead).
(strcpy is just banned because there's no bounds check, and they want to force use of strlcpy instead).