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

Reply via email to