Skip to content

Commit

Permalink
Merge pull request owasp-modsecurity#3016 from M4tteoP/uri_decode_inv…
Browse files Browse the repository at this point in the history
…alid

fix: makes uri decode platform independent
  • Loading branch information
airween authored Mar 5, 2024
2 parents 5a6a538 + fcf205d commit 6d719be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/decode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ std::string uri_decode(const std::string & sSrc) {
while (pSrc < SRC_LAST_DEC) {
if (*pSrc == '%') {
char dec1, dec2;
if (-1 != (dec1 = string::HEX2DEC[*(pSrc + 1)])
&& -1 != (dec2 = string::HEX2DEC[*(pSrc + 2)])) {
if ((char)-1 != (dec1 = string::HEX2DEC[*(pSrc + 1)])
&& (char)-1 != (dec2 = string::HEX2DEC[*(pSrc + 2)])) {
*pEnd++ = (dec1 << 4) + dec2;
pSrc += 3;
continue;
Expand Down

0 comments on commit 6d719be

Please sign in to comment.