From 26f3e2800d53f1030782d768657ccb9b42f8b640 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 13 Aug 2019 18:00:02 +0200 Subject: [PATCH] Honor MBEDTLS_CONFIG_FILE in fuzz tests --- programs/fuzz/onefile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/programs/fuzz/onefile.c b/programs/fuzz/onefile.c index 9e3986d6b7..c845149638 100644 --- a/programs/fuzz/onefile.c +++ b/programs/fuzz/onefile.c @@ -1,8 +1,15 @@ #include #include #include -// Get platform-specific definition + +/* This file doesn't use any Mbed TLS function, but grab config.h anyway + * in case it contains platform-specific #defines related to malloc or + * stdio functions. */ +#if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);