strlcpy restricted to array length. 63/13163/14
authorPat Riehecky <riehecky@fnal.gov>
Wed, 6 Jun 2018 15:55:18 +0000 (10:55 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 26 Feb 2021 15:18:40 +0000 (10:18 -0500)
commita9cff4ab4c9eba40145706778664318de2d89c12
tree48a3024a41f882acf66fbdc3712f5e1c4271fb82
parent4898be6278f6ff4e214dfe993c0aa31262b9036f
strlcpy restricted to array length.

For kaprocs, size of 'caller.userID.name' is defined by a different macro
than size of 'name'.  They can become out of sync, so restricting to
size of dest.
For scout and afsmon-win, the if statement determined that the string
was longer than the dest buffer.  So we are using the size of the buffer
as the max length to setup for truncation.
(via cppcheck)

Change-Id: I38a2bff1d59d17ea02e136c35cd5b132a75a8ed8
Reviewed-on: https://gerrit.openafs.org/13163
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afsmonitor/afsmon-win.c
src/kauth/kaprocs.c
src/scout/scout.c