Skip to content

Commit 6d719be

Browse files
authored
Merge pull request owasp-modsecurity#3016 from M4tteoP/uri_decode_invalid
fix: makes uri decode platform independent
2 parents 5a6a538 + fcf205d commit 6d719be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/decode.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ std::string uri_decode(const std::string & sSrc) {
9999
while (pSrc < SRC_LAST_DEC) {
100100
if (*pSrc == '%') {
101101
char dec1, dec2;
102-
if (-1 != (dec1 = string::HEX2DEC[*(pSrc + 1)])
103-
&& -1 != (dec2 = string::HEX2DEC[*(pSrc + 2)])) {
102+
if ((char)-1 != (dec1 = string::HEX2DEC[*(pSrc + 1)])
103+
&& (char)-1 != (dec2 = string::HEX2DEC[*(pSrc + 2)])) {
104104
*pEnd++ = (dec1 << 4) + dec2;
105105
pSrc += 3;
106106
continue;

0 commit comments

Comments
 (0)