add more fuzzers

Many thanks to Jemma Nelson
@fwip
This commit is contained in:
Sylvestre Ledru
2023-03-10 00:03:26 +01:00
parent e553a4a21c
commit ef0b177e18
4 changed files with 54 additions and 0 deletions
+18
View File
@@ -27,3 +27,21 @@ name = "fuzz_date"
path = "fuzz_targets/fuzz_date.rs"
test = false
doc = false
[[bin]]
name = "fuzz_parse_glob"
path = "fuzz_targets/fuzz_parse_glob.rs"
test = false
doc = false
[[bin]]
name = "fuzz_parse_size"
path = "fuzz_targets/fuzz_parse_size.rs"
test = false
doc = false
[[bin]]
name = "fuzz_parse_time"
path = "fuzz_targets/fuzz_parse_time.rs"
test = false
doc = false
+12
View File
@@ -0,0 +1,12 @@
// spell-checker:ignore libfuzzer
#![no_main]
use libfuzzer_sys::fuzz_target;
use uucore::parse_glob;
fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
_ = parse_glob::from_str(s)
}
});
+12
View File
@@ -0,0 +1,12 @@
// spell-checker:ignore libfuzzer
#![no_main]
use libfuzzer_sys::fuzz_target;
use uucore::parse_size::parse_size;
fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
_ = parse_size(s);
}
});
+12
View File
@@ -0,0 +1,12 @@
// spell-checker:ignore libfuzzer
#![no_main]
use libfuzzer_sys::fuzz_target;
use uucore::parse_time;
fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
_ = parse_time::from_str(s);
}
});