mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Replace usage of range-checked 'at' method when vector/string has already been size checked
This commit is contained in:
@@ -100,13 +100,9 @@ class AnchoredSetVariableTranslationProxy {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<std::string> ret(new std::string(""));
|
||||
auto ret = std::make_unique<std::string>(l[0]->getValue());
|
||||
|
||||
ret->assign(l.at(0)->getValue());
|
||||
|
||||
while (!l.empty()) {
|
||||
auto &a = l.back();
|
||||
l.pop_back();
|
||||
for(auto a : l) {
|
||||
delete a;
|
||||
}
|
||||
|
||||
|
@@ -41,9 +41,9 @@ namespace modsecurity {
|
||||
class Rules {
|
||||
public:
|
||||
void dump() const {
|
||||
for (int j = 0; j < m_rules.size(); j++) {
|
||||
std::cout << " Rule ID: " << m_rules.at(j)->getReference();
|
||||
std::cout << "--" << m_rules.at(j) << std::endl;
|
||||
for (const auto &r : m_rules) {
|
||||
std::cout << " Rule ID: " << r->getReference();
|
||||
std::cout << "--" << r << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user