Disable checksums for builds with fuzzer

This commit is contained in:
Alexey Milovidov 2023-11-22 17:19:59 +01:00
parent ffbe85d3a0
commit 21d3ebcf35
2 changed files with 6 additions and 2 deletions

View File

@ -4,8 +4,8 @@ if (FUZZER)
# NOTE: Eldar Zaitov decided to name it "libfuzzer" instead of "fuzzer" to keep in mind another possible fuzzer backends.
# NOTE: no-link means that all the targets are built with instrumentation for fuzzer, but only some of them
# (tests) have entry point for fuzzer and it's not checked.
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=fuzzer-no-link")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=fuzzer-no-link")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=fuzzer-no-link -DFUZZER=1")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_FLAGS} -fsanitize=fuzzer-no-link -DFUZZER=1")
# NOTE: oss-fuzz can change LIB_FUZZING_ENGINE variable
if (NOT LIB_FUZZING_ENGINE)

View File

@ -25,7 +25,11 @@ protected:
char * compressed_buffer = nullptr;
/// Don't checksum on decompressing.
#if defined(FUZZER)
bool disable_checksum = true;
#else
bool disable_checksum = false;
#endif
/// Allow reading data, compressed by different codecs from one file.
bool allow_different_codecs;