From a23c9d4044d9fe4875e2eabbb02d58a5e2583750 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 19 Apr 2008 23:47:09 +0000 Subject: [PATCH] Insist that RATE and CEIL expressions consist of numbers, parens, and arithmetic operators before trying to compile them git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8447 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Tc.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Shorewall-perl/Shorewall/Tc.pm b/Shorewall-perl/Shorewall/Tc.pm index 43bc383db..865c3a4ec 100644 --- a/Shorewall-perl/Shorewall/Tc.pm +++ b/Shorewall-perl/Shorewall/Tc.pm @@ -402,6 +402,7 @@ sub convert_rate( $$ ) { if ( $rate =~ /\bfull\b/ ) { $rate =~ s/\bfull\b/$full/g; progress_message " Compiling $_[1]"; + fatal_error "Invalid Rate ($_[1])" if $rate =~ m{[^0-9*/+()-]}; $rate = eval "int( $rate )"; fatal_error "Invalid Rate ($_[1])" unless defined $rate; } else {