From owner-svn-src-all@FreeBSD.ORG Sun Dec 18 02:19:59 2011 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 3A070106566C for ; Sun, 18 Dec 2011 02:19:59 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id CA74C8FC08 for ; Sun, 18 Dec 2011 02:19:58 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/afgnrylsiW+xbjV+pgEJ X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (ip-109-45-171-208.web.vodafone.de [109.45.171.208]) by post.strato.de (mrclete mo17) (RZmta 26.15 DYNA|AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id w04f9cnBI0gt1W for ; Sun, 18 Dec 2011 03:19:36 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 18 Dec 2011 03:19:32 +0100 Date: Sun, 18 Dec 2011 03:19:32 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20111218021932.GB2436@britannica.bec.de> References: <201112172335.pBHNZk04081607@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201112172335.pBHNZk04081607@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: svn commit: r228670 - head/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, 18 Dec 2011 02:19:59 -0000 On Sat, Dec 17, 2011 at 11:35:46PM +0000, Dimitry Andric wrote: > Modified: head/usr.sbin/pkg_install/updating/main.c > ============================================================================== > --- head/usr.sbin/pkg_install/updating/main.c Sat Dec 17 23:18:14 2011 (r228669) > +++ head/usr.sbin/pkg_install/updating/main.c Sat Dec 17 23:35:46 2011 (r228670) > @@ -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); Either use strlcat without the pointer modifications or just go with snprintf in first place. This is bogus... Joerg