mirror of
https://github.com/MAGICGrants/cuprate-for-explorer.git
synced 2026-01-09 19:47:59 -05:00
* add fuzz tests * fix CI * fix found vuln * fix deny * add more targets * fmt + clippy * Add exclude for fuzz * add defaults rather than exclude * add fuzz to CI * remove clippy run * add readme * review fixes * Update Cargo.toml Co-authored-by: hinto-janai <hinto.janai@protonmail.com> --------- Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
22 lines
508 B
Rust
22 lines
508 B
Rust
#![no_main]
|
|
|
|
use bytes::{BufMut, BytesMut};
|
|
use libfuzzer_sys::fuzz_target;
|
|
use tokio_util::codec::Decoder;
|
|
|
|
use cuprate_levin::BucketHead;
|
|
use cuprate_wire::{LevinCommand, MoneroWireCodec};
|
|
|
|
fuzz_target!(|data: Vec<(BucketHead<LevinCommand>, Vec<u8>)>| {
|
|
let mut codec = MoneroWireCodec::default();
|
|
|
|
for (bucket, body) in data {
|
|
let mut bytes = BytesMut::new();
|
|
|
|
bucket.write_bytes_into(&mut bytes);
|
|
bytes.put_slice(&body);
|
|
|
|
drop(codec.decode(&mut bytes));
|
|
}
|
|
});
|