Skip to content

Commit 276c7bb

Browse files
committed
Add a fuzz target for readers
No issues so far on this one, thankfully. I'd hate to have to cut a third release in two days.
1 parent 98d9149 commit 276c7bb

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

fuzz/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ path = "fuzz_targets/slice_detected_all_formats.rs"
1919
test = false
2020
doc = false
2121
bench = false
22+
23+
[[bin]]
24+
name = "reader_detected_all_formats"
25+
path = "fuzz_targets/reader_detected_all_formats.rs"
26+
test = false
27+
doc = false
28+
bench = false
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![no_main]
2+
3+
use std::io;
4+
5+
use libfuzzer_sys::fuzz_target;
6+
7+
use xt::Format;
8+
9+
fuzz_target!(|data: &[u8]| {
10+
let _ = xt::translate_reader(&*data, None, Format::Json, io::sink());
11+
let _ = xt::translate_reader(&*data, None, Format::Msgpack, io::sink());
12+
let _ = xt::translate_reader(&*data, None, Format::Toml, io::sink());
13+
let _ = xt::translate_reader(&*data, None, Format::Yaml, io::sink());
14+
});

0 commit comments

Comments
 (0)