Renames: - hb-depend-fuzzer.cc → hb-depend-closure-parity.cc - hb-depend-fuzzer-main.cc → hb-depend-closure-parity-main.cc - hb-depend-security-fuzzer.cc → hb-depend-fuzzer.cc The closure parity test validates correctness by comparing the depend API implementation against the battle-tested subset closure calculation, ensuring the two implementations stay synchronized. It runs on valid fonts from test/api/fonts/. The depend fuzzer is a security fuzzer that tests robustness against malformed input, following the standard HarfBuzz fuzzer pattern. It runs on malformed fonts from test/fuzzing/fonts/. Updated test/fuzzing/README.md to document both tools and their distinct purposes. Updated meson.build to reflect the new naming in test registration.
1.0 KiB
Security Fuzzers
To build the fuzzers with libFuzzer to perform actual fuzzing, build with:
CXX=clang++ CXXFLAGS="-fsanitize=address,fuzzer-no-link" meson fuzzbuild --default-library=static -Dfuzzer_ldflags="-fsanitize=address,fuzzer"
ninja -Cfuzzbuild
Then, run the fuzzer like this:
fuzzbuild/test/fuzzing/hb-{shape,raster,vector,subset,repacker,depend}-fuzzer [-max_len=2048] [CORPUS_DIR]
Where max_len specifies the maximal length of font files to handle. The smaller the faster.
Note: The depend fuzzer requires -Ddepend_api=true meson option.
For more details consult the following locations:
Depend Closure Parity Test
The hb-depend-closure-parity test is distinct from the security fuzzers.
While security fuzzers test robustness against malformed input, the closure
parity test validates correctness by emulating the glyph closure calculation
used for subsetting with one generated from the dependency graph to avoid
implementation divergence. It should only be run on valid fonts.