Skip to content

curl_fuzzer: inject allocations and io failures #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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