diff options
author | truckman <truckman@FreeBSD.org> | 2016-05-20 06:56:43 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2016-05-20 06:56:43 +0000 |
commit | da24c7987e35b6208d9d89babc94b8fcd8345813 (patch) | |
tree | 3084ee11107a281e18dd042151b95c72050f1f00 /usr.sbin/lmcconfig | |
parent | a8991e291712a8a069d99b55947fd11b98120353 (diff) | |
download | FreeBSD-src-da24c7987e35b6208d9d89babc94b8fcd8345813.zip FreeBSD-src-da24c7987e35b6208d9d89babc94b8fcd8345813.tar.gz |
MFC 299866
Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.
Reported by: Coverity
CID: 974852
Diffstat (limited to 'usr.sbin/lmcconfig')
-rw-r--r-- | usr.sbin/lmcconfig/lmcconfig.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/lmcconfig/lmcconfig.c b/usr.sbin/lmcconfig/lmcconfig.c index 7fbc216..95ed87a 100644 --- a/usr.sbin/lmcconfig/lmcconfig.c +++ b/usr.sbin/lmcconfig/lmcconfig.c @@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct iohdr *iohdr) { int error = 0; - strncpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); + strlcpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); iohdr->cookie = NGM_LMC_COOKIE; iohdr->iohdr = iohdr; |