mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Fix regression test and example: checking if rules are loaded ok
It was checking only the amount of rules loaded, which could be 0 if only configuration directives are loaded.
This commit is contained in:
@@ -97,7 +97,7 @@ void perform_unit_test(std::vector<RegressionTest *> *tests,
|
||||
" (ModSecurity regression test utility)");
|
||||
modsec_rules = new ModSecurity::Rules(debug_log);
|
||||
|
||||
if (modsec_rules->load(t->rules.c_str(), filename) == false) {
|
||||
if (modsec_rules->load(t->rules.c_str(), filename) < 0) {
|
||||
if (t->parser_error.empty() == true) {
|
||||
std::cerr << "parse failed." << std::endl;
|
||||
std::cout << modsec_rules->getParserError() << std::endl;
|
||||
|
Reference in New Issue
Block a user