test: add bounded fuzz targets and native-WASM parity

This commit is contained in:
Momoko-Ayase committed 2026-11-05 22:20:09 +08:00
1 parent e0dc177885
commit 767eae2a79
14 files changed
+1111 -3

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
#![no_main]
//! Crackproof PE detection over bounded, attacker-shaped bytes.
//!
//! Ceilings: input is capped by the harness (`-max_len`, see run.sh) and the
//! detector itself reads only fixed header offsets. This target asserts the
//! detector never panics — the folder scanner calls it on untrusted prefixes.
use libfuzzer_sys::fuzz_target;
const MAX_INPUT: usize = 64 * 1024;
fuzz_target!(|data: &[u8]| {
let data = &data[..data.len().min(MAX_INPUT)];
let _ = senbei_engine::detect(data);
});