mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Cosmetics: fix cppcheck warnings
This commit is contained in:
@@ -256,7 +256,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
|
||||
strlen("highlight"));
|
||||
|
||||
yajl_gen_array_open(g);
|
||||
while (vars.size() > 0) {
|
||||
while (vars.size() > 3) {
|
||||
std::string value;
|
||||
yajl_gen_map_open(g);
|
||||
vars.pop_back();
|
||||
@@ -303,7 +303,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
|
||||
varValue.size());
|
||||
yajl_gen_map_close(g);
|
||||
|
||||
while (trans.size() > 0) {
|
||||
while (!trans.empty()) {
|
||||
modsecurity::actions::transformations::Transformation *t;
|
||||
std::string varValueRes;
|
||||
yajl_gen_map_open(g);
|
||||
@@ -338,7 +338,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
|
||||
|
||||
yajl_gen_map_open(g);
|
||||
|
||||
while (ops.size() > 0) {
|
||||
while (ops.size() > 3) {
|
||||
std::string value;
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("highlight"),
|
||||
strlen("highlight"));
|
||||
|
@@ -232,7 +232,7 @@ int JSON::yajl_start_array(void *ctx) {
|
||||
|
||||
int JSON::yajl_end_array(void *ctx) {
|
||||
JSON *tthis = reinterpret_cast<JSON *>(ctx);
|
||||
if (tthis->m_containers.size() <= 0) {
|
||||
if (tthis->m_containers.empty()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ int JSON::yajl_start_map(void *ctx) {
|
||||
*/
|
||||
int JSON::yajl_end_map(void *ctx) {
|
||||
JSON *tthis = reinterpret_cast<JSON *>(ctx);
|
||||
if (tthis->m_containers.size() <= 0) {
|
||||
if (tthis->m_containers.empty()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -91,11 +91,11 @@ bool GeoLookup::setDataBase(const std::string& filePath,
|
||||
#endif
|
||||
err->append(".");
|
||||
|
||||
if (intMax.size() > 0) {
|
||||
if (!intMax.empty()) {
|
||||
err->append(" " + intMax);
|
||||
|
||||
}
|
||||
if (intGeo.size() > 0) {
|
||||
if (!intGeo.empty()) {
|
||||
err->append(" " + intGeo);
|
||||
}
|
||||
return false;
|
||||
|
@@ -38,7 +38,6 @@ class WebAppId : public Variable {
|
||||
void evaluate(Transaction *transaction,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
const std::string name("WEBAPPID");
|
||||
const std::string rname = transaction->m_rules->m_secWebAppId.m_value;
|
||||
l->push_back(new VariableValue(&m_name, &rname));
|
||||
}
|
||||
|
Reference in New Issue
Block a user