From a2c3499bc5d566e755ae948c0ce5e9a1ef00cd6c Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 23 Jan 2026 16:04:16 +0100 Subject: [PATCH] fuzz: restrict nalloc build to libfuzzer --- contrib/oss-fuzz/build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/oss-fuzz/build.sh b/contrib/oss-fuzz/build.sh index 3e8e3657f8..2c137002a7 100755 --- a/contrib/oss-fuzz/build.sh +++ b/contrib/oss-fuzz/build.sh @@ -47,6 +47,10 @@ $CXX $CXXFLAGS -std=c++11 -I. \ -o $OUT/${f} \ -lFuzzingEngine .libs/libpng16.a -lz +# only libfuzzer can run the nalloc targets +if test "x$FUZZING_ENGINE" == 'xlibfuzzer' +then + # wrapper script to duplicate target, run with env var NALLOC_FREQ=32 # having a separate target with allocations failures cat << EOF > $OUT/${f}_nalloc @@ -66,3 +70,6 @@ done cp $SRC/libpng/contrib/oss-fuzz/*.dict \ $SRC/libpng/contrib/oss-fuzz/*.options $OUT/ + +fi +# end