[3/3] firewall.cgi: Make checked and selected hashes private for each single function.

Message ID 20210711175419.3582-3-stefan.schantl@ipfire.org
State Accepted
Commit ec0ed11d711513ca944b2a8f34a0638cf0985246
Headers
Series [1/3] firewall.cgi: Remove faulty assignments for selected hash. |

Commit Message

Stefan Schantl July 11, 2021, 5:54 p.m. UTC
  Some functions uses those two hashes and are altering them - making them
private will erase and fill it with new data.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 html/cgi-bin/firewall.cgi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
  

Patch

diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
index 8d6adee96..0eace5f11 100644
--- a/html/cgi-bin/firewall.cgi
+++ b/html/cgi-bin/firewall.cgi
@@ -1005,6 +1005,10 @@  sub gen_dd_block
 	my $grp=shift;
 	my $helper='';
 	my $show='';
+
+	my %checked = ();
+	my %selected = ();
+
 	$checked{'grp1'}{$fwdfwsettings{'grp1'}} 				= 'CHECKED';
 	$checked{'grp2'}{$fwdfwsettings{'grp2'}} 				= 'CHECKED';
 	$checked{'grp3'}{$fwdfwsettings{'grp3'}} 				= 'CHECKED';
@@ -1482,7 +1486,10 @@  sub newrule
 	&General::readhasharray("$configlocationgrp", \%customlocationgrp);
 	&General::readhasharray("$configipsec", \%ipsecconf);
 	&General::get_aliases(\%aliases);
-	my %checked=();
+
+	my %checked = ();
+	my %selected = ();
+
 	my $helper;
 	my $sum=0;
 	if($fwdfwsettings{'config'} eq ''){$fwdfwsettings{'config'}=$configfwdfw;}