mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +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,
|
||||
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("");
|
||||
ret.assign(tmp);
|
||||
free(tmp);
|
||||
ret.assign(val);
|
||||
free(val);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user