svn commit: r288434 - stable/10/usr.sbin/bhyve

Xin LI delphij at FreeBSD.org
Thu Oct 1 00:44:46 UTC 2015


Author: delphij
Date: Thu Oct  1 00:44:45 2015
New Revision: 288434
URL: https://svnweb.freebsd.org/changeset/base/288434

Log:
  MFC r287927:
  
  Use strlcpy() instead of strncpy() because subsequent mkstemps expects
  the string be nul-terminated.
  
  Reviewed by:	neel

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

Modified: stable/10/usr.sbin/bhyve/acpi.c
==============================================================================
--- stable/10/usr.sbin/bhyve/acpi.c	Thu Oct  1 00:34:38 2015	(r288433)
+++ stable/10/usr.sbin/bhyve/acpi.c	Thu Oct  1 00:44:45 2015	(r288434)
@@ -790,10 +790,10 @@ basl_open(struct basl_fio *bf, int suffi
 	err = 0;
 
 	if (suffix) {
-		strncpy(bf->f_name, basl_stemplate, MAXPATHLEN);
+		strlcpy(bf->f_name, basl_stemplate, MAXPATHLEN);
 		bf->fd = mkstemps(bf->f_name, strlen(BHYVE_ASL_SUFFIX));
 	} else {
-		strncpy(bf->f_name, basl_template, MAXPATHLEN);
+		strlcpy(bf->f_name, basl_template, MAXPATHLEN);
 		bf->fd = mkstemp(bf->f_name);
 	}
 


More information about the svn-src-stable-10 mailing list