1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-02 12:15:36 +00:00
Files
zint/backend/tests/fuzz/README
gitlost 3c193d7306 raster/vector: EAN/UPC: fix calculation of image/vector height to
allow for heights smaller than `textoffset` when have add-on
  (buffer overflow for raster, outside vector height for vector)
raster: EAN/UPC: make sure don't overwrite add-on stuff when
  line-copying guard descenders by limiting copy width
ZBarcode_Encode_Segs: allow for multiple (stacked) rows when
  setting absolute minimum height;
  state stacked symbols max in error message
DBAR_EXP: check length on encoding method 6 before trying to parse
  3-digit currency string with `z_to_int()`
CLI: stop looping over data args when have error;
  suppress taint warning by using fixed `malloc()` size for
  `arg_opts` instead of `argc`
general: use `vsnprintf()` instead of `vsprintf()` if not C89
ULTRACODE: don't call `ult_generate_codewords()` if `length` 0
  from fragment processing (avoids `assert()`)
clang-tidy -> 23 & suppress some warnings
test suite: fuzz: leave Z_FUZZ_DEBUG to compiler, fix comment
general: some minor code-formatting on touched files
README.deb -> README.debian (avoid confusion with actual ".deb")
BWIPP: update to latest
2026-03-26 17:35:13 +00:00

58 lines
1.7 KiB
Plaintext

% backend/tests/fuzz/README 2026-03-26
% Tested on Ubuntu 24.04 LTS
% vim: set ts=4 sw=4 et :
To run fuzzers "fuzz_data" and "fuzz_gs1" using OSS-Fuzz
Assuming have cloned OSS-Fuzz somewhere:
git clone https://github.com/google/oss-fuzz
and using the following shell vars:
export OSS_FUZZ_DIR=<oss-fuzz-clone-dir>
export ZINT_DIR=<zint-clone-dir>
export PROJECT_NAME=zint
make sure have latest:
cd $OSS_FUZZ_DIR
git pull origin master
Link zint's "backend/tests/fuzz" to a sub-dir of OSS-Fuzz`s project dir as "zint", e.g.:
cd $OSS_FUZZ_DIR/projects
ln -s $ZINT_DIR/backend/tests/fuzz $PROJECT_NAME
Create corpus dirs, e.g. could create in the "build" dir in "<oss-fuzz-clone-dir>":
mkdir -p $OSS_FUZZ_DIR/build/corpus_data
mkdir -p $OSS_FUZZ_DIR/build/corpus_gs1
Then can use OSS-Fuzz's python helpers to build the docker image and fuzzers:
cd $OSS_FUZZ_DIR/projects/$PROJECT_NAME
python3 $OSS_FUZZ_DIR/infra/helper.py build_image $PROJECT_NAME
(on any subsequent runs can add "--no-pull" option to avoid the "Pull latest base images" question)
python3 $OSS_FUZZ_DIR/infra/helper.py build_fuzzers $PROJECT_NAME
Then run "fuzz_data":
python3 $OSS_FUZZ_DIR/infra/helper.py run_fuzzer --corpus-dir=build/corpus_data $PROJECT_NAME fuzz_data
and/or "fuzz_gs1":
python3 $OSS_FUZZ_DIR/infra/helper.py run_fuzzer --corpus-dir=build/corpus_gs1 $PROJECT_NAME fuzz_gs1
If want to test local changes not in zint's commit tree, then create an archive, e.g.
cd $ZINT_DIR
git stash
git archive -o backend/tests/fuzz/zint.tar.gz 'stash@{0}'
git stash pop
then edit "Dockerfile" and comment out "RUN zint clone ..." and uncomment "ADD ./zint.tar.gz zint" and
rebuild Docker image and fuzzers.