mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user