Check an arguments count before proceed in sysctl_handler().
PR: bin/56298 Submitted by: Kang Liu <liukang@bjpu.edu.cn> MFC after: 2 weeks # We need a regression test suit for ipfw(2)/ipfw(8) badly.
This commit is contained in:
parent
a26181dca1
commit
1c56ad9b8e
@ -1643,7 +1643,7 @@ sysctl_handler(int ac, char *av[], int which)
|
||||
ac--;
|
||||
av++;
|
||||
|
||||
if (*av == NULL) {
|
||||
if (ac == 0) {
|
||||
warnx("missing keyword to enable/disable\n");
|
||||
} else if (strncmp(*av, "firewall", strlen(*av)) == 0) {
|
||||
sysctlbyname("net.inet.ip.fw.enable", NULL, 0,
|
||||
|
Loading…
Reference in New Issue
Block a user