ids.cgi: Add check when altering the ruleset

Add a check if the currently processing sid is nummeric, otherwise skip it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2017-12-13 11:46:40 +01:00
parent 525998650a
commit c51a044a2a

View File

@@ -153,6 +153,9 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'update'}) {
foreach my $rulefile (keys %snortrules) {
# Loop through the single rules of the rulefile.
foreach my $sid (keys %{$snortrules{$rulefile}}) {
# Skip the current sid if it is not numeric.
next unless ($sid =~ /\d+/ );
# Check if there exists a key in the cgiparams hash for this sid.
if (exists($cgiparams{$sid})) {
# Look if the rule is disabled.