mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Adds error messages while failed to init a collection
This commit is contained in:
parent
193fa2e804
commit
7d06c32b0d
@ -32,9 +32,11 @@ bool InitCol::init(std::string *error) {
|
|||||||
int posEquals = m_parser_payload.find("=");
|
int posEquals = m_parser_payload.find("=");
|
||||||
|
|
||||||
if (m_parser_payload.size() < 8) {
|
if (m_parser_payload.size() < 8) {
|
||||||
|
error->assign("Something wrong with initcol format: too small");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (posEquals == std::string::npos) {
|
if (posEquals == std::string::npos) {
|
||||||
|
error->assign("Something wrong with initcol format: missing equals sign");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +44,7 @@ bool InitCol::init(std::string *error) {
|
|||||||
m_collection_value = std::string(m_parser_payload, posEquals + 1);
|
m_collection_value = std::string(m_parser_payload, posEquals + 1);
|
||||||
|
|
||||||
if (m_collection_key != "ip" && m_collection_key != "global") {
|
if (m_collection_key != "ip" && m_collection_key != "global") {
|
||||||
|
error->assign("Something wrong with initcol: collection must be `ip' or `global'");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user