diff options
author | maxim <maxim@FreeBSD.org> | 2003-09-02 10:36:40 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2003-09-02 10:36:40 +0000 |
commit | c789fb5e2063c3015f4ed9c429611ba4e1fd6fc4 (patch) | |
tree | 7545dd30eadff3b280aceb4315574494c322e1f6 /sbin/ipfw | |
parent | 089f3c60d4f25befc0538372e474dd987f4dfebc (diff) | |
download | FreeBSD-src-c789fb5e2063c3015f4ed9c429611ba4e1fd6fc4.zip FreeBSD-src-c789fb5e2063c3015f4ed9c429611ba4e1fd6fc4.tar.gz |
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.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index c77efa8..bec3c2a 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -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, |