diff options
-rw-r--r-- | dumpelf.c | 2 | ||||
-rw-r--r-- | fuzz-ar.c | 3 | ||||
-rw-r--r-- | paxinc.h | 9 |
3 files changed, 7 insertions, 7 deletions
@@ -579,8 +579,6 @@ static void parseargs(int argc, char *argv[]) #if PAX_UTILS_LIBFUZZ int LLVMFuzzerInitialize(int *argc, char ***argv) { - (void)argc; - (void)argv; (void)parseargs; security_init(false); return 0; @@ -15,9 +15,6 @@ static int fd; int LLVMFuzzerInitialize(int *argc, char ***argv) { - (void)argc; - (void)argv; - fd = memfd_create("fuzz-input.a", MFD_CLOEXEC); if (fd == -1) errp("memfd_create() failed"); @@ -112,9 +112,14 @@ const char *strfileperms(const char *fname); #define PTR_ALIGN_DOWN(base, size) ((__typeof__(base))ALIGN_DOWN((uintptr_t)(base), (size))) #define PTR_ALIGN_UP(base, size) ((__typeof__(base))ALIGN_UP ((uintptr_t)(base), (size))) -/* Support for libFuzzer: https://llvm.org/docs/LibFuzzer.html */ +/* + * Support for libFuzzer: https://llvm.org/docs/LibFuzzer.html + * No headers define this API, so we have to do it ourselves. + */ #if PAX_UTILS_LIBFUZZ -int LLVMFuzzerInitialize(__unused__ int *argc, __unused__ char ***argv); +int LLVMFuzzerInitialize(int *argc, char ***argv); +/* Attributes on the prototype are ignored, so hack the definition. */ +#define LLVMFuzzerInitialize(c, v) LLVMFuzzerInitialize(__unused__ c, __unused__ v) int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); #endif |