Revert back to using custom HTTP parser instead of Boost.Beast (#6407)

This commit is contained in:
Siarhei Fedartsou
2022-10-14 14:37:33 +02:00
committed by GitHub
parent d143de597d
commit 9d160a9b5d
8 changed files with 445 additions and 87 deletions
+2 -1
View File
@@ -38,7 +38,8 @@ if (ENABLE_FUZZING)
"table_parameters"
"tile_parameters"
"trip_parameters"
"url_parser")
"url_parser"
"request_parser")
foreach (target ${ServerTargets})
add_fuzz_target(${target})
+28
View File
@@ -0,0 +1,28 @@
#include "server/request_parser.hpp"
#include "server/http/request.hpp"
#include "util.hpp"
#include <iterator>
#include <string>
using osrm::server::RequestParser;
using osrm::server::http::request;
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, unsigned long size)
{
std::string in(reinterpret_cast<const char *>(data), size);
auto first = begin(in);
auto last = end(in);
RequestParser parser;
request req;
// &(*it) is needed to go from iterator to underlying item to pointer to underlying item
parser.parse(req, &(*first), &(*last));
escape(&req);
return 0;
}