Make all "rule id" variables of type RuleId

Previously, ModSecurity inconsistently used RuleId, int and double for
rule id variables in different places.
This commit is contained in:
WGH
2020-07-24 20:12:35 +03:00
committed by Felipe Zimmerle
parent d023ddffcd
commit bbaffc8f3d
6 changed files with 62 additions and 61 deletions

View File

@@ -2880,10 +2880,10 @@ namespace yy {
#line 1480 "seclang-parser.yy"
{
std::string error;
double ruleId;
try {
ruleId = std::stod(yystack_[1].value.as < std::string > ());
} catch (...) {
std::istringstream iss(yystack_[1].value.as < std::string > ());
RuleId ruleId;
iss >> ruleId;
if (iss.fail()) {
std::stringstream ss;
ss << "SecRuleUpdateTargetById: failed to load:";
ss << "The input \"" + yystack_[1].value.as < std::string > () + "\" does not ";
@@ -2910,10 +2910,10 @@ namespace yy {
#line 1506 "seclang-parser.yy"
{
std::string error;
double ruleId;
try {
ruleId = std::stod(yystack_[1].value.as < std::string > ());
} catch (...) {
std::istringstream iss(yystack_[1].value.as < std::string > ());
RuleId ruleId;
iss >> ruleId;
if (iss.fail()) {
std::stringstream ss;
ss << "SecRuleUpdateActionById: failed to load:";
ss << "The input \"" + yystack_[1].value.as < std::string > () + "\" does not ";

View File

@@ -1479,10 +1479,10 @@ expression:
| CONFIG_SEC_RULE_UPDATE_TARGET_BY_ID variables_pre_process
{
std::string error;
double ruleId;
try {
ruleId = std::stod($1);
} catch (...) {
std::istringstream iss($1);
RuleId ruleId;
iss >> ruleId;
if (iss.fail()) {
std::stringstream ss;
ss << "SecRuleUpdateTargetById: failed to load:";
ss << "The input \"" + $1 + "\" does not ";
@@ -1505,10 +1505,10 @@ expression:
| CONFIG_SEC_RULE_UPDATE_ACTION_BY_ID actions
{
std::string error;
double ruleId;
try {
ruleId = std::stod($1);
} catch (...) {
std::istringstream iss($1);
RuleId ruleId;
iss >> ruleId;
if (iss.fail()) {
std::stringstream ss;
ss << "SecRuleUpdateActionById: failed to load:";
ss << "The input \"" + $1 + "\" does not ";