aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-02-08 14:20:38 +0000
committerMark Johnston <markj@FreeBSD.org>2021-02-08 14:20:38 +0000
commitc7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7 (patch)
tree6391a577ba07e3acc51d0b5ee7a0a9480d2b2cbf
parentdb6b56441e3a142e7fe58a5a85d9071e772a943e (diff)
downloadsrc-c7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7.tar.gz
src-c7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7.zip
binmiscctl: Avoid segfault with "binmiscctl add" and no extra params
MFC after: 1 week
-rw-r--r--usr.sbin/binmiscctl/binmiscctl.c2
1 files changed, 2 insertions, 0 deletions
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);