mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-20 02:57:12 +03:00
Cosmetics: Fix static analysis warnings
This commit is contained in:
@@ -61,7 +61,6 @@ Action *Action::instantiate(const std::string& name) {
|
||||
std::string block("block");
|
||||
std::string phase("phase:");
|
||||
std::string rule_id("id:");
|
||||
std::string severity("severity:");
|
||||
|
||||
if (name.compare(0, status.length(), status) == 0) {
|
||||
return new Status(name);
|
||||
|
||||
@@ -33,7 +33,8 @@ namespace actions {
|
||||
class RuleId : public Action {
|
||||
public:
|
||||
explicit RuleId(std::string action)
|
||||
: Action(action, ConfigurationKind) { }
|
||||
: Action(action, ConfigurationKind),
|
||||
m_ruleId(0) { }
|
||||
|
||||
bool init(std::string *error) override;
|
||||
bool evaluate(Rule *rule, Assay *assay) override;
|
||||
|
||||
@@ -101,7 +101,6 @@ void SetVar::dump() {
|
||||
|
||||
bool SetVar::evaluate(Rule *rule, Assay *assay) {
|
||||
std::string targetValue;
|
||||
int value = 0;
|
||||
std::string variableNameExpanded = MacroExpansion::expand(variableName,
|
||||
assay);
|
||||
std::string resolvedPre = MacroExpansion::expand(predicate, assay);
|
||||
@@ -112,6 +111,8 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
|
||||
targetValue = std::string("1");
|
||||
} else {
|
||||
int pre = 0;
|
||||
int value = 0;
|
||||
|
||||
try {
|
||||
pre = stoi(resolvedPre);
|
||||
} catch (...) {
|
||||
|
||||
@@ -38,9 +38,7 @@ ReplaceComments::ReplaceComments(std::string action)
|
||||
|
||||
std::string ReplaceComments::evaluate(std::string value,
|
||||
Assay *assay) {
|
||||
|
||||
uint64_t i, j, incomment;
|
||||
int changed = 0;
|
||||
|
||||
char *input = reinterpret_cast<char *>(
|
||||
malloc(sizeof(char) * value.size() + 1));
|
||||
@@ -52,7 +50,6 @@ std::string ReplaceComments::evaluate(std::string value,
|
||||
if (incomment == 0) {
|
||||
if ((input[i] == '/') && (i + 1 < value.size())
|
||||
&& (input[i + 1] == '*')) {
|
||||
changed = 1;
|
||||
incomment = 1;
|
||||
i += 2;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user