Skip to content

Commit 0dc42e4

Browse files
kaoudiscmeister2
authored andcommitted
fuzzer: fuzz several filepaths
1 parent 2836c75 commit 0dc42e4

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

curl_fuzzer.cc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,24 @@ int fuzz_set_easy_options(FUZZ_DATA *fuzz)
192192
fuzz_write_callback));
193193
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_WRITEDATA, fuzz));
194194

195-
/* Set the cookie jar so cookies are tested. */
195+
/* Set the writable cookie jar path so cookies are tested. */
196196
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_COOKIEJAR, FUZZ_COOKIE_JAR_PATH));
197197

198+
/* Set the RO cookie file path so cookies are tested. */
199+
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_COOKIEFILE, FUZZ_RO_COOKIE_FILE_PATH));
200+
201+
/* Set altsvc header cache filepath so that it can be fuzzed. */
202+
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_ALTSVC, FUZZ_ALT_SVC_HEADER_CACHE_PATH));
203+
204+
/* Set the hsts header cache filepath so that it can be fuzzed. */
205+
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_HSTS, FUZZ_HSTS_HEADER_CACHE_PATH));
206+
207+
/* Set the Certificate Revocation List file path so it can be fuzzed */
208+
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_CRLFILE, FUZZ_CRL_FILE_PATH));
209+
210+
/* Set the .netrc file path so it can be fuzzed */
211+
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_NETRC_FILE, FUZZ_NETRC_FILE_PATH));
212+
198213
/* Time out requests quickly. */
199214
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_TIMEOUT_MS, 200L));
200215
FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_SERVER_RESPONSE_TIMEOUT, 1L));

curl_fuzzer.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,24 @@
9595
/* convenience string for HTTPPOST body name */
9696
#define FUZZ_HTTPPOST_NAME "test"
9797

98-
/* Cookie-jar path. */
98+
/* Cookie-jar WRITE (CURLOPT_COOKIEJAR) path. */
9999
#define FUZZ_COOKIE_JAR_PATH "/dev/null"
100100

101+
/* Cookie-jar READ (CURLOPT_COOKIEFILE) path. */
102+
#define FUZZ_RO_COOKIE_FILE_PATH "/dev/null"
103+
104+
/* Alt-Svc header cache path */
105+
#define FUZZ_ALT_SVC_HEADER_CACHE_PATH "/dev/null"
106+
107+
/* HSTS header cache path */
108+
#define FUZZ_HSTS_HEADER_CACHE_PATH "/dev/null"
109+
110+
/* Certificate Revocation List file path */
111+
#define FUZZ_CRL_FILE_PATH "/dev/null"
112+
113+
/* .netrc file path */
114+
#define FUZZ_NETRC_FILE_PATH "/dev/null"
115+
101116
/* Number of supported responses */
102117
#define TLV_MAX_NUM_RESPONSES 11
103118

0 commit comments

Comments
 (0)