summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/add
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>2003-01-06 07:39:02 +0000
committerjkh <jkh@FreeBSD.org>2003-01-06 07:39:02 +0000
commit99a8dbd2abcc4a5b3e91176537e4a2539317c506 (patch)
tree18330404214398e2f4f18fe73650c7a1a793b318 /usr.sbin/pkg_install/add
parenta1b0e44458dd92011644d1ef5627aa3d99b04fb3 (diff)
downloadFreeBSD-src-99a8dbd2abcc4a5b3e91176537e4a2539317c506.zip
FreeBSD-src-99a8dbd2abcc4a5b3e91176537e4a2539317c506.tar.gz
Prevent buffer overflow in format_cmd() by properly tracking maximum
buffer size. Reported by: Lionnel CHAPTAL <Lionnel.Chaptal@IPricot.com> MFC after: 1 week
Diffstat (limited to 'usr.sbin/pkg_install/add')
-rw-r--r--usr.sbin/pkg_install/add/extract.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/add/extract.c b/usr.sbin/pkg_install/add/extract.c
index 83f46e3..f35cce2 100644
--- a/usr.sbin/pkg_install/add/extract.c
+++ b/usr.sbin/pkg_install/add/extract.c
@@ -223,7 +223,7 @@ extract_plist(const char *home, Package *pkg)
errx(2, "%s: no directory specified for '%s' command",
__func__, p->name);
}
- format_cmd(cmd, p->name, Directory, last_file);
+ format_cmd(cmd, FILENAME_MAX, p->name, Directory, last_file);
PUSHOUT(Directory);
if (Verbose)
printf("extract: execute '%s'\n", cmd);
OpenPOWER on IntegriCloud