Date: Thu, 1 Oct 2015 00:44:45 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r288434 - stable/10/usr.sbin/bhyve Message-ID: <201510010044.t910ijCM084766@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510010044.t910ijCM084766>