From ce90ed78b62e475685cead09a294023c825e14d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> Date: Tue, 17 Apr 2018 12:41:34 +0200 Subject: [PATCH] * fuzz/wget_options_fuzzer.c: Write fuzzer crash reports --- fuzz/wget_options_fuzzer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fuzz/wget_options_fuzzer.c b/fuzz/wget_options_fuzzer.c index 9c52b723..3c21db2d 100644 --- a/fuzz/wget_options_fuzzer.c +++ b/fuzz/wget_options_fuzzer.c @@ -87,10 +87,15 @@ FILE *fopen(const char *pathname, const char *mode) if (dont_write) { size_t len = strlen(pathname); + const char *p; if (len >= 7 && !strcmp(pathname + len - 7, ".wgetrc") && !strcmp(mode, "r")) return fmemopen((void *) g_data, g_size, mode); + if ((p = strstr(pathname, "crash-")) && strlen(p) == 46) { + printf("open %s, %s\n", pathname, mode); + return libc_fopen(pathname, mode); + } // if (*mode == 'w') return libc_fopen("/dev/null", mode);