Skip to content

Commit

Permalink
Build fuzzers by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Sep 23, 2023
1 parent 3690582 commit 27ad73c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
15 changes: 13 additions & 2 deletions regress/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
check_function_exists(getopt HAVE_GETOPT)

set(FUZZ_PROGRAMS
zip_read_encrypted_file_fuzzer
zip_read_file_fuzzer
zip_read_fuzzer
zip_write_encrypt_aes256_file_fuzzer
zip_write_encrypt_pkware_file_fuzzer
)

set(TEST_PROGRAMS
add_from_filep
can_clone_file
fopen_unchanged
fseek
fuzz_main
nonrandomopentest
liboverride-test
)
Expand All @@ -20,7 +27,7 @@ set(HOLE_USERS
ziptool_regress
)

set(ZIP_PROGRAMS ${TEST_PROGRAMS} ${GETOPT_USERS} ${HOLE_USERS})
set(ZIP_PROGRAMS ${TEST_PROGRAMS} ${GETOPT_USERS} ${HOLE_USERS} ${FUZZ_PROGRAMS})

foreach(PROGRAM IN LISTS ZIP_PROGRAMS)
add_executable(${PROGRAM} ${PROGRAM}.c)
Expand All @@ -40,6 +47,10 @@ foreach(PROGRAM IN LISTS HOLE_USERS)
target_sources(${PROGRAM} PRIVATE source_hole.c)
endforeach()

foreach(PROGRAM IN LISTS FUZZ_PROGRAMS)
target_sources(${PROGRAM} PRIVATE fuzz_main.c)
endforeach()

# for including ziptool.c
target_include_directories(ziptool_regress PRIVATE BEFORE ${PROJECT_SOURCE_DIR}/src)

Expand Down
1 change: 0 additions & 1 deletion regress/fuzz_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "fuzzers/zip_read_fuzzer.c"
#include <stdio.h>
#include <stdlib.h>

Expand Down
10 changes: 5 additions & 5 deletions regress/ossfuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_
make -j$(nproc)

$CXX $CXXFLAGS -I. -I../lib \
$SRC/libzip/regress/fuzzers/zip_read_encrypted_file_fuzzer.c \
$SRC/libzip/regress/zip_read_encrypted_file_fuzzer.c \
-o $OUT/zip_read_encrypted_file_fuzzer \
$LIB_FUZZING_ENGINE $SRC/libzip/build/lib/libzip.a -lz -v -lssl -lcrypto

$CXX $CXXFLAGS -I. -I../lib \
$SRC/libzip/regress/fuzzers/zip_read_file_fuzzer.c \
$SRC/libzip/regress/zip_read_file_fuzzer.c \
-o $OUT/zip_read_file_fuzzer \
$LIB_FUZZING_ENGINE $SRC/libzip/build/lib/libzip.a -lz -v -lssl -lcrypto

$CXX $CXXFLAGS -I. -I../lib \
$SRC/libzip/regress/fuzzers/zip_read_fuzzer.c \
$SRC/libzip/regress/zip_read_fuzzer.c \
-o $OUT/zip_read_fuzzer \
$LIB_FUZZING_ENGINE $SRC/libzip/build/lib/libzip.a -lz -v -lssl -lcrypto

$CXX $CXXFLAGS -I. -I../lib \
$SRC/libzip/regress/fuzzers/zip_write_encrypt_aes256_file_fuzzer.c \
$SRC/libzip/regress/zip_write_encrypt_aes256_file_fuzzer.c \
-o $OUT/zip_write_encrypt_aes256_file_fuzzer \
$LIB_FUZZING_ENGINE $SRC/libzip/build/lib/libzip.a -lz -v -lssl -lcrypto

$CXX $CXXFLAGS -I. -I../lib \
$SRC/libzip/regress/fuzzers/zip_write_encrypt_pkware_file_fuzzer.c \
$SRC/libzip/regress/zip_write_encrypt_pkware_file_fuzzer.c \
-o $OUT/zip_write_encrypt_pkware_file_fuzzer \
$LIB_FUZZING_ENGINE $SRC/libzip/build/lib/libzip.a -lz -v -lssl -lcrypto

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 27ad73c

Please sign in to comment.