mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Cosmetics: Fix static analysis warnings
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "operators/detect_sqli.h"
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
#include "operators/operator.h"
|
||||
#include "others/libinjection/src/libinjection.h"
|
||||
|
@@ -30,19 +30,15 @@ bool DetectXSS::evaluate(Assay *assay, const std::string &input) {
|
||||
|
||||
is_xss = libinjection_xss(input.c_str(), input.length());
|
||||
|
||||
if (is_xss) {
|
||||
if (assay) {
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
if (is_xss) {
|
||||
assay->debug(5, "detected XSS using libinjection.");
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
} else {
|
||||
assay->debug(9, "libinjection was not able to " \
|
||||
"find any XSS in: " + input);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (negation) {
|
||||
|
@@ -75,33 +75,29 @@ bool Operator::debug(Assay *assay, int x, std::string a) {
|
||||
|
||||
|
||||
bool Operator::evaluate(Assay *assay) {
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
if (assay) {
|
||||
assay->debug(2, "Operator: " + this->op + \
|
||||
" is not implemented or malfunctioning.");
|
||||
#endif
|
||||
} else {
|
||||
#ifndef NO_LOGS
|
||||
std::cerr << "Operator: " + this->op + \
|
||||
" is not implemented or malfunctioning.";
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Operator::evaluate(Assay *assay, const std::string& a) {
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
if (assay) {
|
||||
assay->debug(2, "Operator: " + this->op + \
|
||||
" is not implemented or malfunctioning.");
|
||||
#endif
|
||||
} else {
|
||||
#ifndef NO_LOGS
|
||||
std::cerr << "Operator: " + this->op + \
|
||||
" is not implemented or malfunctioning.";
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -70,7 +70,6 @@ int VerifyCC::luhnVerify(const char *ccnumber, int len) {
|
||||
|
||||
|
||||
bool VerifyCC::init(const std::string ¶m2, const char **error) {
|
||||
std::vector<std::string> vec;
|
||||
const char *errptr = NULL;
|
||||
int erroffset = 0;
|
||||
|
||||
|
@@ -28,7 +28,9 @@ class VerifyCC : public Operator {
|
||||
public:
|
||||
/** @ingroup ModSecurity_Operator */
|
||||
VerifyCC(std::string op, std::string param, bool negation)
|
||||
: Operator(op, param, negation) { }
|
||||
: Operator(op, param, negation),
|
||||
m_pc(NULL),
|
||||
m_pce(NULL) { }
|
||||
|
||||
int luhnVerify(const char *ccnumber, int len);
|
||||
bool evaluate(Assay *assay, const std::string &input) override;
|
||||
|
Reference in New Issue
Block a user