mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Handling key exceptions on the variable itself
This is the first step towords to solve #1697
This commit is contained in:
@@ -371,8 +371,9 @@ class RulesProperties {
|
||||
from->m_responseBodyTypeToBeInspected.m_value.clear();
|
||||
} else {
|
||||
for (std::set<std::string>::iterator
|
||||
it = from->m_responseBodyTypeToBeInspected.m_value.begin();
|
||||
it != from->m_responseBodyTypeToBeInspected.m_value.end(); ++it) {
|
||||
it = from->m_responseBodyTypeToBeInspected.m_value.begin();
|
||||
it != from->m_responseBodyTypeToBeInspected.m_value.end();
|
||||
++it) {
|
||||
to->m_responseBodyTypeToBeInspected.m_value.insert(*it);
|
||||
}
|
||||
}
|
||||
@@ -433,7 +434,7 @@ class RulesProperties {
|
||||
for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) {
|
||||
std::vector<modsecurity::Rule *> *rules_to = to+i;
|
||||
std::vector<modsecurity::Rule *> *rules_from = from+i;
|
||||
// TODO: std::vector could be replaced with something more efficient.
|
||||
// FIXME: std::vector could be replaced with something more efficient.
|
||||
std::vector<int64_t> v;
|
||||
v.reserve(rules_to->size());
|
||||
for (size_t z = 0; z < rules_to->size(); z++) {
|
||||
@@ -443,11 +444,11 @@ class RulesProperties {
|
||||
}
|
||||
v.push_back(rule_ckc->m_ruleId);
|
||||
}
|
||||
std::sort (v.begin(), v.end());
|
||||
std::sort(v.begin(), v.end());
|
||||
|
||||
for (size_t j = 0; j < rules_from->size(); j++) {
|
||||
Rule *rule = rules_from->at(j);
|
||||
if (std::binary_search (v.begin(), v.end(), rule->m_ruleId)) {
|
||||
if (std::binary_search(v.begin(), v.end(), rule->m_ruleId)) {
|
||||
if (err != NULL) {
|
||||
*err << "Rule id: " \
|
||||
<< std::to_string(rule->m_ruleId) \
|
||||
|
Reference in New Issue
Block a user