diff --git a/headers/modsecurity/rule.h b/headers/modsecurity/rule.h index 644e4f43..cd856aeb 100644 --- a/headers/modsecurity/rule.h +++ b/headers/modsecurity/rule.h @@ -90,34 +90,35 @@ class Rule { class RuleMessage { public: - RuleMessage(Rule *rule) { - m_ruleFile = rule->m_fileName; - m_ruleLine = rule->m_lineNumber; - m_ruleId = rule->rule_id; - m_rev = rule->m_rev; - m_accuracy = rule->m_accuracy; - m_message = std::string(""); - m_data = std::string(""); - m_severity = 0; - m_ver = rule->m_ver; - m_maturity = rule->m_maturity; - m_rule = rule; - m_match = std::string(""); - }; - RuleMessage(Rule *rule, std::string message) { - m_ruleFile = rule->m_fileName; - m_ruleLine = rule->m_lineNumber; - m_ruleId = rule->rule_id; - m_rev = rule->m_rev; - m_accuracy = rule->m_accuracy; - m_message = message; - m_data = std::string(""); - m_severity = 0; - m_ver = rule->m_ver; - m_maturity = rule->m_maturity; - m_rule = rule; - m_match = std::string(""); - }; + RuleMessage(Rule *rule) : + m_ruleFile(rule->m_fileName), + m_ruleLine(rule->m_lineNumber), + m_ruleId(rule->rule_id), + m_rev(rule->m_rev), + m_accuracy(rule->m_accuracy), + m_message(std::string("")), + m_data(std::string("")), + m_severity(0), + m_ver(rule->m_ver), + m_maturity(rule->m_maturity), + m_rule(rule), + m_match(std::string("")) + { } + + RuleMessage(Rule *rule, std::string message) : + m_ruleFile(rule->m_fileName), + m_ruleLine(rule->m_lineNumber), + m_ruleId(rule->rule_id), + m_rev(rule->m_rev), + m_accuracy(rule->m_accuracy), + m_message(message), + m_data(std::string("")), + m_severity(0), + m_ver(rule->m_ver), + m_maturity(rule->m_maturity), + m_rule(rule), + m_match(std::string("")) + { } std::string m_match; std::string m_ruleFile; diff --git a/src/actions/init_col.cc b/src/actions/init_col.cc index ad35a52d..e7eaec8a 100644 --- a/src/actions/init_col.cc +++ b/src/actions/init_col.cc @@ -53,6 +53,8 @@ bool InitCol::init(std::string *error) { bool InitCol::evaluate(Rule *rule, Transaction *transaction) { std::string collectionName; collectionName = MacroExpansion::expand(m_collection_value, transaction); + std::cout << "Collection is not implemented yet, here is the "; + std::cout << "collection name: " << collectionName << std::endl; return true; } diff --git a/src/operators/rbl.cc b/src/operators/rbl.cc index 89d96cdc..fc716e60 100644 --- a/src/operators/rbl.cc +++ b/src/operators/rbl.cc @@ -114,7 +114,7 @@ void Rbl::futherInfo_httpbl(struct sockaddr_in *sin, std::string ipStr, debug(trans, 4, "RBL lookup of " + ipStr + " succeeded. %s: " \ + std::to_string(days) + " " \ "days since last activity, threat score " \ - + std::to_string(score)); + + std::to_string(score) + ". Case: " + ptype); } diff --git a/src/utils.cc b/src/utils.cc index fe20c122..6a01f706 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -125,7 +125,6 @@ void chomp(std::string *str) { std::string tolower(std::string str) { - std::locale loc; std::string value; value.resize(str.length()); diff --git a/test/fuzzer/afl_fuzzer.cc b/test/fuzzer/afl_fuzzer.cc index 01d904d3..d41a78ef 100644 --- a/test/fuzzer/afl_fuzzer.cc +++ b/test/fuzzer/afl_fuzzer.cc @@ -116,15 +116,13 @@ using namespace modsecurity; int main(int argc, char** argv) { - size_t count; - uint8_t buf[128]; - ssize_t read_bytes; + uint8_t buf[128]; std::string lastString; while (__AFL_LOOP(1000)) { + ssize_t read_bytes; // (re-) initialize the library and read new input - read_bytes = -1; memset(buf, 0, 128); read_bytes = read(STDIN_FILENO, buf, 128);