mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 18:30:35 +03:00
Refactoring: Makes transformations to work with new execute signature
This commit is contained in:
@@ -32,28 +32,27 @@ namespace actions {
|
||||
namespace transformations {
|
||||
|
||||
|
||||
std::string ParityEven7bit::execute(const std::string &value,
|
||||
Transaction *transaction) {
|
||||
std::string ret;
|
||||
void ParityEven7bit::execute(Transaction *t,
|
||||
ModSecStackString &in,
|
||||
ModSecStackString &out) {
|
||||
unsigned char *input;
|
||||
|
||||
input = reinterpret_cast<unsigned char *>
|
||||
(malloc(sizeof(char) * value.length()+1));
|
||||
(malloc(sizeof(char) * in.length()+1));
|
||||
|
||||
if (input == NULL) {
|
||||
return "";
|
||||
return;
|
||||
}
|
||||
|
||||
std::memcpy(input, value.c_str(), value.length()+1);
|
||||
std::memcpy(input, in.c_str(), in.length()+1);
|
||||
|
||||
inplace(input, value.length());
|
||||
inplace(input, in.length());
|
||||
|
||||
ret.assign(reinterpret_cast<char *>(input), value.length());
|
||||
out.assign(reinterpret_cast<char *>(input), in.length());
|
||||
free(input);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool ParityEven7bit::inplace(unsigned char *input, uint64_t input_len) {
|
||||
uint64_t i;
|
||||
|
||||
@@ -76,7 +75,6 @@ bool ParityEven7bit::inplace(unsigned char *input, uint64_t input_len) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace transformations
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
||||
Reference in New Issue
Block a user