Fix fuzzing
This commit is contained in:
+2
-2
@@ -12,13 +12,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
/* Pad the fuzz */
|
||||
uWS::HttpParser httpParser;
|
||||
memcpy(padded + 32, data, size);
|
||||
memcpy(padded, data, size);
|
||||
|
||||
/* User data */
|
||||
void *user = (void *) 13;
|
||||
|
||||
/* Parse it */
|
||||
httpParser.consumePostPadded(padded + 32, size, user, [](void *s, uWS::HttpRequest *httpRequest) -> void * {
|
||||
httpParser.consumePostPadded(padded, size, user, [](void *s, uWS::HttpRequest *httpRequest) -> void * {
|
||||
|
||||
/* todo: Route this via router */
|
||||
|
||||
|
||||
+2
-2
@@ -92,7 +92,7 @@ class HttpParser {
|
||||
|
||||
private:
|
||||
std::string fallback;
|
||||
int remainingStreamingBytes = 0;
|
||||
unsigned int remainingStreamingBytes = 0;
|
||||
|
||||
const size_t MAX_FALLBACK_SIZE = 1024 * 4;
|
||||
|
||||
@@ -166,7 +166,7 @@ private:
|
||||
remainingStreamingBytes = toUnsignedInteger(contentLengthString);
|
||||
|
||||
if (!CONSUME_MINIMALLY) {
|
||||
int emittable = std::min(remainingStreamingBytes, length);
|
||||
unsigned int emittable = std::min<unsigned int>(remainingStreamingBytes, length);
|
||||
dataHandler(user, std::string_view(data, emittable), emittable == remainingStreamingBytes);
|
||||
remainingStreamingBytes -= emittable;
|
||||
|
||||
|
||||
+1
-1
Submodule uSockets updated: d67d75db2c...215d079bb1
Reference in New Issue
Block a user