From 1957673703fb5e5865bfc4412393e20302569392 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 21 Oct 2018 13:14:44 +0200 Subject: [PATCH] fuzz: Fix assertion failed: (fuzz_handle != NULL) for fuzzshark_ip If no dissector is defined, the macro should not be defined either. Change-Id: If9c24d2b223e93f1d42f8a7444fd019aad4c5c1d Fixes: v2.9.0rc0-2266-g7e88bb5e53 ("fuzzshark: integrate oss-fuzz targets in CMake") Reviewed-on: https://code.wireshark.org/review/30299 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- fuzz/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fuzz/CMakeLists.txt b/fuzz/CMakeLists.txt index c572f90c52..6bc57500e3 100644 --- a/fuzz/CMakeLists.txt +++ b/fuzz/CMakeLists.txt @@ -104,9 +104,12 @@ function(generate_fuzzer dissector_table name) fuzzshark_set_common_options(${fuzzer_name}) target_compile_definitions(${fuzzer_name} PRIVATE FUZZ_DISSECTOR_LIST=${FUZZ_DISABLED_DISSECTORS_MACRO} - FUZZ_DISSECTOR_TABLE="${dissector_table}" FUZZ_DISSECTOR_TARGET="${name}" ) + if(NOT dissector_table STREQUAL "") + target_compile_definitions(${fuzzer_name} PRIVATE + FUZZ_DISSECTOR_TABLE="${dissector_table}") + endif() endfunction() # Add fuzzer targets for every dissector in list FUZZ__DISSECTORS,