binmiscctl: Avoid segfault with "binmiscctl add" and no extra params

(cherry picked from commit c7fcb36f56)
This commit is contained in:
Mark Johnston 2021-02-08 09:20:38 -05:00
parent 03bb5b837d
commit 78534b222b

View File

@ -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);