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 <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2018-10-21 13:14:44 +02:00
parent 9f74af24f1
commit 1957673703
1 changed files with 4 additions and 1 deletions

View File

@ -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_<table-var>_DISSECTORS,