mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +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("=");
|
||||
|
||||
if (m_parser_payload.size() < 8) {
|
||||
error->assign("Something wrong with initcol format: too small");
|
||||
return false;
|
||||
}
|
||||
if (posEquals == std::string::npos) {
|
||||
error->assign("Something wrong with initcol format: missing equals sign");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -42,6 +44,7 @@ bool InitCol::init(std::string *error) {
|
||||
m_collection_value = std::string(m_parser_payload, posEquals + 1);
|
||||
|
||||
if (m_collection_key != "ip" && m_collection_key != "global") {
|
||||
error->assign("Something wrong with initcol: collection must be `ip' or `global'");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user