mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
move the fuzz_date fuzzers
This commit is contained in:
parent
234ef07abd
commit
e553a4a21c
3 changed files with 7 additions and 4 deletions
16
fuzz/fuzz_targets/fuzz_date.rs
Normal file
16
fuzz/fuzz_targets/fuzz_date.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// spell-checker:ignore libfuzzer
|
||||
|
||||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
use std::ffi::OsString;
|
||||
use uu_date::uumain;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let delim: u8 = 0; // Null byte
|
||||
let args = data
|
||||
.split(|b| *b == delim)
|
||||
.filter_map(|e| std::str::from_utf8(e).ok())
|
||||
.map(|e| OsString::from(e));
|
||||
uumain(args);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue