mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
cosmetics: Address some cppcheck complains
This commit is contained in:
parent
51d06d7a8e
commit
ae3ad5eaa7
@ -38,7 +38,7 @@ bool DetectSQLi::evaluate(Transaction *t, RuleWithActions *rule,
|
|||||||
ms_dbg_a(t, 4, "detected SQLi using libinjection with " \
|
ms_dbg_a(t, 4, "detected SQLi using libinjection with " \
|
||||||
"fingerprint '" + std::string(fingerprint) + "' at: '" +
|
"fingerprint '" + std::string(fingerprint) + "' at: '" +
|
||||||
input + "'");
|
input + "'");
|
||||||
if (rule && t && rule->hasCaptureAction()) {
|
if (rule && rule->hasCaptureAction()) {
|
||||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||||
"0", std::string(fingerprint));
|
"0", std::string(fingerprint));
|
||||||
ms_dbg_a(t, 7, "Added DetectSQLi match TX.0: " + \
|
ms_dbg_a(t, 7, "Added DetectSQLi match TX.0: " + \
|
||||||
|
@ -34,7 +34,7 @@ bool DetectXSS::evaluate(Transaction *t, RuleWithActions *rule,
|
|||||||
if (t) {
|
if (t) {
|
||||||
if (is_xss) {
|
if (is_xss) {
|
||||||
ms_dbg_a(t, 5, "detected XSS using libinjection.");
|
ms_dbg_a(t, 5, "detected XSS using libinjection.");
|
||||||
if (rule && t && rule->hasCaptureAction()) {
|
if (rule && rule->hasCaptureAction()) {
|
||||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||||
"0", std::string(input));
|
"0", std::string(input));
|
||||||
ms_dbg_a(t, 7, "Added DetectXSS match TX.0: " + \
|
ms_dbg_a(t, 7, "Added DetectXSS match TX.0: " + \
|
||||||
|
@ -141,7 +141,7 @@ bool VerifyCC::evaluate(Transaction *t, RuleWithActions *rule,
|
|||||||
int is_cc = luhnVerify(match.c_str(), match.size());
|
int is_cc = luhnVerify(match.c_str(), match.size());
|
||||||
if (is_cc) {
|
if (is_cc) {
|
||||||
if (t) {
|
if (t) {
|
||||||
if (rule && t && rule->hasCaptureAction()) {
|
if (rule && rule->hasCaptureAction()) {
|
||||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||||
"0", std::string(match));
|
"0", std::string(match));
|
||||||
ms_dbg_a(t, 7, "Added VerifyCC match TX.0: " + \
|
ms_dbg_a(t, 7, "Added VerifyCC match TX.0: " + \
|
||||||
|
@ -58,8 +58,8 @@ RuleWithOperator::RuleWithOperator(Operator *op,
|
|||||||
std::unique_ptr<std::string> fileName,
|
std::unique_ptr<std::string> fileName,
|
||||||
int lineNumber)
|
int lineNumber)
|
||||||
: RuleWithActions(actions, transformations, std::move(fileName), lineNumber),
|
: RuleWithActions(actions, transformations, std::move(fileName), lineNumber),
|
||||||
m_operator(op),
|
m_variables(_variables),
|
||||||
m_variables(_variables) { /* */ }
|
m_operator(op) { /* */ }
|
||||||
|
|
||||||
|
|
||||||
RuleWithOperator::~RuleWithOperator() {
|
RuleWithOperator::~RuleWithOperator() {
|
||||||
|
@ -50,7 +50,7 @@ namespace modsecurity {
|
|||||||
int RulesSet::loadFromUri(const char *uri) {
|
int RulesSet::loadFromUri(const char *uri) {
|
||||||
Driver *driver = new Driver();
|
Driver *driver = new Driver();
|
||||||
|
|
||||||
if (driver->parseFile(uri) == false) {
|
if (driver->parseFile(uri) == 0) {
|
||||||
m_parserError << driver->m_parserError.str();
|
m_parserError << driver->m_parserError.str();
|
||||||
delete driver;
|
delete driver;
|
||||||
return -1;
|
return -1;
|
||||||
@ -66,7 +66,7 @@ int RulesSet::loadFromUri(const char *uri) {
|
|||||||
int RulesSet::load(const char *file, const std::string &ref) {
|
int RulesSet::load(const char *file, const std::string &ref) {
|
||||||
Driver *driver = new Driver();
|
Driver *driver = new Driver();
|
||||||
|
|
||||||
if (driver->parse(file, ref) == false) {
|
if (driver->parse(file, ref) == 0) {
|
||||||
m_parserError << driver->m_parserError.str();
|
m_parserError << driver->m_parserError.str();
|
||||||
delete driver;
|
delete driver;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user