mjson icon indicating copy to clipboard operation
mjson copied to clipboard

Add fuzzing by way of ClusterFuzzLite

Open DavidKorczynski opened this issue 1 year ago • 0 comments

This adds fuzzing by way of ClusterFuzzLite, which is a GitHub action that will perform a short amount of fuzzing for new PRs. The goal is to use fuzzing to catch bugs that may be introduced by new PRs.

I added a fuzzer that targets mjson and mjson_find, and currently set the timeout of CFLite to 100 seconds. CFLite will flag if the fuzzer finds any issues in the code introduced by a PR.

For a quick way of reproducing the fuzzing set up by way of OSS-Fuzz (which is the infra ClusterFuzzLite will use):

git clone https://github.com/google/oss-fuzz
git clone https://github.com/DavidKorczynski/mjson mjson
cd mjson
git checkout clusterfuzz-lite-integration 

# Build the fuzzers in .clusterfuzzlite
python3 ../oss-fuzz/infra/helper.py build_fuzzers --external $PWD

# Run the fuzzer for 10 seconds
python3 ../oss-fuzz/infra/helper.py run_fuzzer --external $PWD mjson_fuzzer -- -max_total_time=10

DavidKorczynski avatar Dec 21 '23 22:12 DavidKorczynski