]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use strlcpy() instead of strncpy() when copying the encoding value
authortruckman <truckman@FreeBSD.org>
Thu, 12 May 2016 08:41:22 +0000 (08:41 +0000)
committertruckman <truckman@FreeBSD.org>
Thu, 12 May 2016 08:41:22 +0000 (08:41 +0000)
commit1cbdd13fe92e5b4285a86f56a09b80d821cda19a
tree7fef4f21f40b1bf3953027b75c8160f3416d1e50
parentfe66d1db50181bfa0ea5e3308043e9a7900332d5
Use strlcpy() instead of strncpy() when copying the encoding value
to ensure that the destination is NUL terminated.  Length truncation
of one more character should not be an issue since encoding values
that long are not supported by libc.  The destination string is
treated as a NUL terminated string, but it is only passed to strcmp()
for comparison to a set of shorter, fixed length strings, so this
is not a serious problem.

Reported by: Coverity
CID: 974769
MFC after: 1 week
usr.bin/mklocale/yacc.y