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
This commit is contained in:
teastep 2008-04-19 23:47:09 +00:00
parent eefef500de
commit a23c9d4044

View File

@ -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 {