Date: Mon, 15 Feb 2021 19:23:55 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 78534b222b99 - stable/13 - binmiscctl: Avoid segfault with "binmiscctl add" and no extra params Message-ID: <202102151923.11FJNtX4085275@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=78534b222b99f516f1f464675ad0bd92f880f3cf commit 78534b222b99f516f1f464675ad0bd92f880f3cf Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-02-08 14:20:38 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-15 19:12:25 +0000 binmiscctl: Avoid segfault with "binmiscctl add" and no extra params (cherry picked from commit c7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7) --- usr.sbin/binmiscctl/binmiscctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/binmiscctl/binmiscctl.c b/usr.sbin/binmiscctl/binmiscctl.c index 471f4c2c68dd..3c5e19def67b 100644 --- a/usr.sbin/binmiscctl/binmiscctl.c +++ b/usr.sbin/binmiscctl/binmiscctl.c @@ -284,6 +284,8 @@ add_cmd(__unused int argc, char *argv[], ximgact_binmisc_entry_t *xbe) char *magic = NULL, *mask = NULL; int sz; + if (argc == 0) + usage("Required argument missing\n"); if (strlen(argv[0]) > IBE_NAME_MAX) usage("'%s' string length longer than IBE_NAME_MAX (%d)", IBE_NAME_MAX);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102151923.11FJNtX4085275>