coreutils/fuzz/fuzz_targets/fuzz_date.rs

15 lines
313 B
Rust
Raw Normal View History

#![no_main]
use libfuzzer_sys::fuzz_target;
use std::ffi::OsString;
use uu_date::uumain;
fuzz_target!(|data: &[u8]| {
2023-03-07 12:40:59 +00:00
let delim: u8 = 0; // Null byte
let args = data
.split(|b| *b == delim)
.filter_map(|e| std::str::from_utf8(e).ok())
2023-09-28 19:52:26 +00:00
.map(OsString::from);
2023-03-07 12:40:59 +00:00
uumain(args);
});