From owner-svn-src-all@freebsd.org Thu Sep 17 18:11:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF72C9CE8A6; Thu, 17 Sep 2015 18:11:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B04111EEA; Thu, 17 Sep 2015 18:11:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8HIBRi4029963; Thu, 17 Sep 2015 18:11:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8HIBRD7029962; Thu, 17 Sep 2015 18:11:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509171811.t8HIBRD7029962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 17 Sep 2015 18:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287927 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2015 18:11:27 -0000 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); }