Commit 72a5367e authored by jan.koester's avatar jan.koester
Browse files

test

parent 27a4b517
Loading
Loading
Loading
Loading
+10 −2
Changes for src/http.cpp: 10 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1673,8 +1673,16 @@ void libhttppp::HttpForm::urlDecode(const std::string &in,std::string &out){
        {
            case '%':
                if ( ( i + 2 < nd ) && ( std::isxdigit(*(i + 1)) && std::isxdigit(*(i + 2)) ) ) {
          char hs[]{ i[1], i[2] };
          out.push_back(static_cast<char>(strtol(hs, nullptr, 16)));
                    char hs[]{ i[1], i[2], '\0' };
                    char decoded_char = static_cast<char>(strtol(hs, nullptr, 16));

                    if (decoded_char == '\0') {
                        HTTPException e;
                        e[HTTPException::Error] << "Url decoded result contained null character ('%00')!";
                        throw e;
                    }

                    out.push_back(decoded_char);
                    i += 2;
                }else{
                    HTTPException e;