1
Fork 0
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:
Sylvestre Ledru 2023-03-07 23:23:07 +01:00
parent 234ef07abd
commit e553a4a21c
3 changed files with 7 additions and 4 deletions

View 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);
});