From owner-svn-src-all@FreeBSD.ORG Sun Jan 1 23:18:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618581065676; Sun, 1 Jan 2012 23:18:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB878FC1D; Sun, 1 Jan 2012 23:18:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q01NIZG6036360; Sun, 1 Jan 2012 23:18:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q01NIZ1r036358; Sun, 1 Jan 2012 23:18:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201012318.q01NIZ1r036358@svn.freebsd.org> From: Dimitry Andric Date: Sun, 1 Jan 2012 23:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229234 - stable/9/usr.sbin/pkg_install/updating X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 01 Jan 2012 23:18:35 -0000 Author: dim Date: Sun Jan 1 23:18:34 2012 New Revision: 229234 URL: http://svn.freebsd.org/changeset/base/229234 Log: MFC r228670: In usr.sbin/pkg_install/updating/main.c, use the size of the destination buffer as size argument to strlcpy(), not the length of the source. Modified: stable/9/usr.sbin/pkg_install/updating/main.c Directory Properties: stable/9/usr.sbin/pkg_install/updating/ (props changed) Modified: stable/9/usr.sbin/pkg_install/updating/main.c ============================================================================== --- stable/9/usr.sbin/pkg_install/updating/main.c Sun Jan 1 23:17:21 2012 (r229233) +++ stable/9/usr.sbin/pkg_install/updating/main.c Sun Jan 1 23:18:34 2012 (r229234) @@ -141,7 +141,7 @@ main(int argc, char *argv[]) strcmp(pkgdbdir->d_name, "..") != 0) { /* Create path to +CONTENTS file for each installed port */ - n = strlcpy(tmp_file, pkgdbpath, strlen(pkgdbpath)+1); + n = strlcpy(tmp_file, pkgdbpath, sizeof(tmp_file)); n = strlcpy(tmp_file + n, "/", sizeof(tmp_file) - n); n = strlcat(tmp_file + n, pkgdbdir->d_name, sizeof(tmp_file) - n); @@ -181,7 +181,7 @@ main(int argc, char *argv[]) (void)exit(EXIT_FAILURE); if (pname[strlen(pname) - 1] == '\n') pname[strlen(pname) - 1] = '\0'; - strlcpy (curr->name, pname, strlen(pname)+1); + strlcpy (curr->name, pname, sizeof(curr->name)); curr->next = head; head = curr; }