mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Fix jsDecode transformation
This commit is contained in:
parent
3331744175
commit
8d78952e18
@ -36,11 +36,15 @@ namespace transformations {
|
|||||||
|
|
||||||
std::string JsDecode::evaluate(std::string value,
|
std::string JsDecode::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
char *tmp = strdup(value.c_str());
|
|
||||||
js_decode_nonstrict_inplace((unsigned char *)tmp, value.size());
|
char *val = (char *) malloc(sizeof(char) * value.size() + 1);
|
||||||
|
memcpy(val, value.c_str(), value.size() + 1);
|
||||||
|
val[value.size()] = '\0';
|
||||||
|
|
||||||
|
js_decode_nonstrict_inplace((unsigned char *)val, value.size());
|
||||||
std::string ret("");
|
std::string ret("");
|
||||||
ret.assign(tmp);
|
ret.assign(val);
|
||||||
free(tmp);
|
free(val);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user