mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Code cosmetics: reduce the amount of cppcheck warnings
This commit is contained in:
@@ -31,7 +31,7 @@ SetVar::SetVar(std::string action)
|
||||
|
||||
|
||||
bool SetVar::init(std::string *error) {
|
||||
size_t pos = std::string::npos;
|
||||
size_t pos;
|
||||
|
||||
// Resolv operation
|
||||
operation = setToOne;
|
||||
|
@@ -37,7 +37,7 @@ namespace transformations {
|
||||
std::string CssDecode::evaluate(std::string value,
|
||||
Assay *assay) {
|
||||
char *tmp = strdup(value.c_str());
|
||||
int res = css_decode_inplace((unsigned char *)tmp, value.size());
|
||||
css_decode_inplace((unsigned char *)tmp, value.size());
|
||||
std::string ret(tmp, 0, value.size());
|
||||
free(tmp);
|
||||
return ret;
|
||||
|
@@ -37,7 +37,7 @@ namespace transformations {
|
||||
std::string HtmlEntityDecode::evaluate(std::string value,
|
||||
Assay *assay) {
|
||||
char *tmp = strdup(value.c_str());
|
||||
int res = html_entities_decode_inplace((unsigned char *)tmp, value.size());
|
||||
html_entities_decode_inplace((unsigned char *)tmp, value.size());
|
||||
std::string ret("");
|
||||
ret.assign(tmp);
|
||||
free(tmp);
|
||||
|
@@ -37,7 +37,7 @@ namespace transformations {
|
||||
std::string JsDecode::evaluate(std::string value,
|
||||
Assay *assay) {
|
||||
char *tmp = strdup(value.c_str());
|
||||
int res = js_decode_nonstrict_inplace((unsigned char *)tmp, value.size());
|
||||
js_decode_nonstrict_inplace((unsigned char *)tmp, value.size());
|
||||
std::string ret("");
|
||||
ret.assign(tmp);
|
||||
free(tmp);
|
||||
|
@@ -38,7 +38,7 @@ std::string NormalisePathWin::evaluate(std::string value,
|
||||
Assay *assay) {
|
||||
int changed;
|
||||
char *tmp = strdup(value.c_str());
|
||||
int res = normalize_path_inplace((unsigned char *)tmp,
|
||||
normalize_path_inplace((unsigned char *)tmp,
|
||||
value.size(), 1, &changed);
|
||||
std::string ret("");
|
||||
ret.assign(tmp);
|
||||
|
@@ -38,7 +38,7 @@ std::string UrlDecodeUni::evaluate(std::string value,
|
||||
Assay *assay) {
|
||||
int changed = 0;
|
||||
char *tmp = strdup(value.c_str());
|
||||
int res = urldecode_uni_nonstrict_inplace_ex(assay, (unsigned char *)tmp,
|
||||
urldecode_uni_nonstrict_inplace_ex(assay, (unsigned char *)tmp,
|
||||
value.size(), &changed);
|
||||
std::string ret("");
|
||||
ret.assign(tmp);
|
||||
|
Reference in New Issue
Block a user