svn commit: r229234 - stable/9/usr.sbin/pkg_install/updating
Dimitry Andric
dim at FreeBSD.org
Sun Jan 1 23:18:35 UTC 2012
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;
}
More information about the svn-src-all
mailing list