Skip to content

Commit

Permalink
build: make fuzzing work on 0.13.0 and master
Browse files Browse the repository at this point in the history
  • Loading branch information
ianprime0509 committed Sep 16, 2024
1 parent fb2a0a8 commit ee8e09b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ tests within. Due to features missing in the current parser implementation (DTD
support), many tests are currently skipped. At the time of writing, 250 tests
pass, and 924 are skipped due to unsupported features.

## Fuzzing

There is a fuzzing sub-project in the `fuzz` directory using
https://github.com/kristoff-it/zig-afl-kit. If running on Zig 0.13.0, an extra
step needs to be taken to make the fuzzing more effective:
https://github.com/kristoff-it/zig-afl-kit/blob/main/README.md#-------important-------
On Zig master, this is not needed.

## License

zig-xml is free software, released under the [Zero Clause BSD
Expand Down
2 changes: 1 addition & 1 deletion fuzz/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn build(b: *std.Build) void {
});
afl_obj.root_module.stack_check = false;
afl_obj.root_module.link_libc = true;
//afl_obj.root_module.fuzz = true;
if (@hasField(@TypeOf(afl_obj.root_module), "fuzz")) afl_obj.root_module.fuzz = true;
afl_obj.root_module.addImport("xml", xml.module("xml"));

const afl_exe = afl.addInstrumentedExe(b, target, .Debug, afl_obj);
Expand Down

0 comments on commit ee8e09b

Please sign in to comment.