svn commit: r287927 - head/usr.sbin/bhyve

Xin LI delphij at FreeBSD.org
Thu Sep 17 18:11:27 UTC 2015


Author: delphij
Date: Thu Sep 17 18:11:26 2015
New Revision: 287927
URL: https://svnweb.freebsd.org/changeset/base/287927

Log:
  Use strlcpy() instead of strncpy() because subsequent mkstemps expects
  the string be nul-terminated.
  
  Reviewed by:	neel
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D3685

Modified:
  head/usr.sbin/bhyve/acpi.c

Modified: head/usr.sbin/bhyve/acpi.c
==============================================================================
--- head/usr.sbin/bhyve/acpi.c	Thu Sep 17 17:56:23 2015	(r287926)
+++ head/usr.sbin/bhyve/acpi.c	Thu Sep 17 18:11:26 2015	(r287927)
@@ -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-all mailing list