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;
 
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to