commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.6k stars 527 forks source link

fuzz: Test more parser entry points #538

Closed nwellnhof closed 3 months ago

nwellnhof commented 3 months ago

Use the upper bits of 'options' to select a parser mode from

jgm commented 3 months ago

CIFuzz is failing after this. Do you want me to merge it anyway?

nwellnhof commented 3 months ago

It turned out that the libFuzzer Makefile target didn't enable ASan. I force pushed some fixes.

posix (macos, clang, shared) now failed because of a timeout. This seems unrelated.

nwellnhof commented 3 months ago

I force-pushed again and all tests are green.

nwellnhof commented 3 months ago

OSS-Fuzz coverage is now at 96%: https://storage.googleapis.com/oss-fuzz-coverage/cmark/reports/20240402/linux/src/cmark/src/report.html

My plan is to add a fuzzer for the uncovered tree API functions similar to work I recently completed on libxml2: https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/fuzz/api.c?ref_type=heads. But this might take a while.