mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 00:11:14 +01:00
The SVG paint backend could keep going after failing-malloc poisoned the root or nested group body buffers. In particular, hb_vector_paint_ensure_initialized() only checked group_stack itself, not the allocated root body, and some group and glyph paths ignored push_or_fail() or append-induced vector error state. Treat an errored root body as initialization failure, reject cached and non-cached glyph emission when defs, current body, or captured scratch enter error state, and stop ignoring nested group push failure. Testing: CCACHE_DISABLE=1 meson test -C build-codex Fixes: https://oss-fuzz.com/testcase-detail/4521131913838592 Assisted-by: OpenAI Codex
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,set}-fuzzer [-max_len=2048] [CORPUS_DIR]
Where max_len specifies the maximal length of font files to handle. The smaller the faster.
For more details consult the following locations: