From e97c2778ff750896f65bebe3d09de6d7479f8b7e Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 1 Aug 2012 14:45:41 -0400 Subject: Protect against a potential infinite loop here. --- usr/local/www/firewall_nat_out.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr/local') diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 07a492e..a254bc7 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -138,7 +138,8 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { /* PPTP subnet */ if (($config['pptpd']['mode'] == "server") && is_private_ip($config['pptpd']['remoteip'])) { - $pptptopip = $config['pptpd']['n_pptp_units'] - 1; + $pptp_size = empty($config['pptpd']['n_pptp_units']) ? 16 : $config['pptpd']['n_pptp_units']; + $pptptopip = $pptp_size - 1; $pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+$pptptopip)); foreach ($pptp_subnets as $pptpsn) { $natent = array(); -- cgit v1.1