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:
maxim 2003-09-02 10:36:40 +00:00
parent 8665bb5af3
commit a916b5a9ab

View File

@ -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,