Date: Sun, 18 Dec 2011 03:19:32 +0100 From: Joerg Sonnenberger <joerg@britannica.bec.de> To: svn-src-all@freebsd.org Subject: Re: svn commit: r228670 - head/usr.sbin/pkg_install/updating Message-ID: <20111218021932.GB2436@britannica.bec.de> In-Reply-To: <201112172335.pBHNZk04081607@svn.freebsd.org> References: <201112172335.pBHNZk04081607@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111218021932.GB2436>
