Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions curl_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <curl/curl.h>
#include "curl_fuzzer.h"

#include "nallocinc.c"

/**
* Fuzzing entry point. This function is passed a buffer containing a test
* case. This test case should drive the CURL API into making a request.
Expand All @@ -49,6 +51,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
goto EXIT_LABEL;
}

nalloc_init(NULL);
/* Try to initialize the fuzz data */
FTRY(fuzz_initialize_fuzz_data(&fuzz, data, size));

Expand Down Expand Up @@ -93,8 +96,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
curl_easy_setopt(fuzz.easy, CURLOPT_HTTPPOST, fuzz.httppost);
}

nalloc_start(data, size);
/* Run the transfer. */
fuzz_handle_transfer(&fuzz);
nalloc_end();

EXIT_LABEL:

Expand Down
Loading
Loading