summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2007-02-01 15:52:47 +0000
committerpav <pav@FreeBSD.org>2007-02-01 15:52:47 +0000
commit4c4dfdea1b2ed220d9b76f87a2295de46745c77c (patch)
tree025c962514685959f266024f522fc2e03f11c09d /usr.sbin/pkg_install
parent8cefd1665ae9ebe4efb8a8487b02e13984d6fca5 (diff)
downloadFreeBSD-src-4c4dfdea1b2ed220d9b76f87a2295de46745c77c.zip
FreeBSD-src-4c4dfdea1b2ed220d9b76f87a2295de46745c77c.tar.gz
Fix previous rev.: don't step behind the end of memory we allocate
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/add/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c
index 61caab1..0750a76 100644
--- a/usr.sbin/pkg_install/add/main.c
+++ b/usr.sbin/pkg_install/add/main.c
@@ -178,7 +178,7 @@ main(int argc, char **argv)
argv += optind;
if (AddMode != SLAVE) {
- pkgs = (char **)malloc(argc * sizeof(char *));
+ pkgs = (char **)malloc((argc+1) * sizeof(char *));
for (ch = 0; ch <= argc; pkgs[ch++] = NULL) ;
/* Get all the remaining package names, if any */
OpenPOWER on IntegriCloud