mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Fix case sensitive variable resolution in in memory backend
Variables are case insensitive
This commit is contained in:
@@ -99,7 +99,9 @@ void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
|
||||
if (x.first.at(keySize) != ':') {
|
||||
continue;
|
||||
}
|
||||
if (x.first.compare(0, keySize, var) != 0) {
|
||||
std::string fu = toupper(x.first);
|
||||
std::string fvar = toupper(var);
|
||||
if (fu.compare(0, keySize, fvar) != 0) {
|
||||
continue;
|
||||
}
|
||||
l->insert(l->begin(), new Variable(x.first, x.second));
|
||||
|
@@ -59,7 +59,7 @@ struct MyHash{
|
||||
// You might need a better hash function than this
|
||||
size_t h = 0;
|
||||
std::for_each(Keyval.begin(), Keyval.end(), [&](char c) {
|
||||
h += c;
|
||||
h += tolower(c);
|
||||
});
|
||||
return h;
|
||||
}
|
||||
|
Reference in New Issue
Block a user