summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-12-17 23:35:46 +0000
committerdim <dim@FreeBSD.org>2011-12-17 23:35:46 +0000
commit45ec4ed05861af4d5fa1803c522d61d29def8c29 (patch)
treea097774f4c1c72879ca178a42dc80d87de8effce /usr.sbin/pkg_install
parent8698d2b7e13e2c203953fc1586a25535baa39c9d (diff)
downloadFreeBSD-src-45ec4ed05861af4d5fa1803c522d61d29def8c29.zip
FreeBSD-src-45ec4ed05861af4d5fa1803c522d61d29def8c29.tar.gz
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. MFC after: 1 week
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/updating/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/updating/main.c b/usr.sbin/pkg_install/updating/main.c
index 0ab2ec0..138922b 100644
--- a/usr.sbin/pkg_install/updating/main.c
+++ b/usr.sbin/pkg_install/updating/main.c
@@ -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;
}
OpenPOWER on IntegriCloud