]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids.cgi: Add check when altering the ruleset
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 13 Dec 2017 10:46:40 +0000 (11:46 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 26 Jul 2018 09:46:00 +0000 (11:46 +0200)
Add a check if the currently processing sid is nummeric, otherwise skip it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index 2fd4a2f9031ed5dfdd6554f8ddef33a0efcb9c09..63f914701b207c4e0d74ae6b4e904bf161b927ab 100644 (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.