mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fix to_hex_if_need function on string utils
This fix issue #1535. Solution was the same suggested on #1523.
This commit is contained in:
parent
8d6209f652
commit
4b9bd499eb
@ -136,7 +136,7 @@ std::string toHexIfNeeded(const std::string &str) {
|
||||
std::stringstream res;
|
||||
|
||||
for (int i = 0; i < str.size(); i++) {
|
||||
int c = str.at(i);
|
||||
int c = (unsigned char)str.at(i);
|
||||
if (c < 32 || c > 126) {
|
||||
res << "\\x" << std::setw(2) << std::setfill('0') << std::hex << c;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user