Ensure that network/prefix is valid
authorJamie Cameron <jcameron@webmin.com>
Sun, 15 Jun 2008 21:06:32 +0000 (21:06 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 15 Jun 2008 21:06:32 +0000 (21:06 +0000)
firewall/save_rule.cgi

index 7e360b5..79026fe 100755 (executable)
@@ -371,6 +371,6 @@ sub check_ipmask
 return &check_ipaddress($_[0]) || gethostbyname($_[0]) ||
        $_[0] =~ /^([0-9\.]+)\/([0-9\.]+)$/ &&
                (&check_ipaddress("$1") || gethostbyname("$1")) &&
-               (&check_ipaddress("$2") || $2 =~ /^\d+$/);
+               (&check_ipaddress("$2") || ($2 =~ /^\d+$/ && $2 <= 32));
 }