test(format): fuzz every plugin-filter decoder for panics

Audited LZF, bitshuffle, bzip2 and Blosc/BloscLZ for arithmetic on
header fields and unchecked slicing. The only live bug was the Blosc
frame-size underflow fixed in the previous commit; bzip2's output-growth
step now uses a saturating subtraction as well (the allocator may hand
back more capacity than asked for).

src/test_fuzz.rs (tests only) feeds each decoder random bytes, truncated
seeds and one-to-four-edit mutations of valid frames, biased towards
edge-case u32 values in size and offset fields, and asserts no panic and
no output over the limit (tests build with overflow checks and debug
assertions). Per decoder: LZF, bzip2, bitshuffle in all six mode/block
settings plus hostile cd_values, Blosc across four codecs, three shuffles,
stored frames and a hand-built BloscLZ frame, and BloscLZ streams alone.
With the previous commit's check removed, fuzzed_frames_never_panic panics
at the same subtraction. A 100x-iteration soak (different seed) found no
other panic.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 01:16:44 -05:00
co-authored by Claude Opus 5.5
parent 9416c58723
commit 7f52a6f3ba
6 changed files with 331 additions and 1 deletions
+10
View File
@@ -117,6 +117,16 @@ pub mod shared_message;
pub mod signature;
pub mod superblock;
pub mod symbol_table;
#[cfg(all(
test,
any(
feature = "lzf",
feature = "bitshuffle",
feature = "bzip2",
feature = "blosc"
)
))]
mod test_fuzz;
pub mod type_builders;
pub mod vds;
pub mod vl_data;