From 99a8dbd2abcc4a5b3e91176537e4a2539317c506 Mon Sep 17 00:00:00 2001 From: jkh Date: Mon, 6 Jan 2003 07:39:02 +0000 Subject: Prevent buffer overflow in format_cmd() by properly tracking maximum buffer size. Reported by: Lionnel CHAPTAL MFC after: 1 week --- usr.sbin/pkg_install/add/extract.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.sbin/pkg_install/add') 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); -- cgit v1.1