svn commit: r300279 - stable/10/usr.sbin/lmcconfig

Don Lewis truckman at FreeBSD.org
Fri May 20 06:56:44 UTC 2016


Author: truckman
Date: Fri May 20 06:56:43 2016
New Revision: 300279
URL: https://svnweb.freebsd.org/changeset/base/300279

Log:
  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

Modified:
  stable/10/usr.sbin/lmcconfig/lmcconfig.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c
==============================================================================
--- stable/10/usr.sbin/lmcconfig/lmcconfig.c	Fri May 20 06:54:59 2016	(r300278)
+++ stable/10/usr.sbin/lmcconfig/lmcconfig.c	Fri May 20 06:56:43 2016	(r300279)
@@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct io
 {
   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;
 


More information about the svn-src-all mailing list