From d9aec9fc713b6889dd3d7f3f8a5cf6864a579d1b Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 19 Feb 2019 14:38:59 +0100 Subject: [PATCH] fuzzer tests: update of mdns and lwip host compilation for fuzzer testing Closes IDF-540 * Original commit: espressif/esp-idf@bc60bbbeaf89f2bbfc5db4bd4f1e7ace81a2ab37 --- components/mdns/test_afl_fuzz_host/Makefile | 4 +++- components/mdns/test_afl_fuzz_host/esp32_compat.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/mdns/test_afl_fuzz_host/Makefile b/components/mdns/test_afl_fuzz_host/Makefile index 61bedc520..6d19d3bf0 100644 --- a/components/mdns/test_afl_fuzz_host/Makefile +++ b/components/mdns/test_afl_fuzz_host/Makefile @@ -1,7 +1,9 @@ TEST_NAME=test FUZZ=afl-fuzz COMPONENTS_DIR=../.. -CFLAGS=-g -DMDNS_TEST_MODE -I. -I.. -I../include -I../private_include -I$(COMPONENTS_DIR)/tcpip_adapter/include -I$(COMPONENTS_DIR)/esp32/include -include esp32_compat.h +CFLAGS=-g -DHOOK_MALLOC_FAILED -DESP_EVENT_H_ -D__ESP_LOG_H__ -DMDNS_TEST_MODE \ + -I. -I.. -I../include -I../private_include -include esp32_compat.h \ + -I$(COMPONENTS_DIR)/tcpip_adapter/include -I$(COMPONENTS_DIR)/esp_event/include -I$(COMPONENTS_DIR)/log/include MDNS_C_DEPENDENCY_INJECTION=-include mdns_di.h ifeq ($(INSTR),off) CC=gcc diff --git a/components/mdns/test_afl_fuzz_host/esp32_compat.h b/components/mdns/test_afl_fuzz_host/esp32_compat.h index 7a662607c..e054c18bb 100644 --- a/components/mdns/test_afl_fuzz_host/esp32_compat.h +++ b/components/mdns/test_afl_fuzz_host/esp32_compat.h @@ -57,6 +57,7 @@ #define portMAX_DELAY 0xFFFFFFFF #define portTICK_PERIOD_MS 1 +#define ESP_LOGD(a,b) #define xSemaphoreTake(s,d) #define xTaskDelete(a) @@ -65,6 +66,7 @@ #define _mdns_pcb_init(a,b) true #define _mdns_pcb_deinit(a,b) true #define xSemaphoreCreateMutex() malloc(1) +#define xSemaphoreCreateBinary() malloc(1) #define vSemaphoreDelete(s) free(s) #define xTaskCreatePinnedToCore(a,b,c,d,e,f,g) *(f) = malloc(1) #define vTaskDelay(m) usleep((m)*0)