Skip to main content

MAX_DATA_LEN

Constant MAX_DATA_LEN 

Source
pub const MAX_DATA_LEN: u64 = _; // 268_435_456u64
Expand description

Per-frame upper bound on a parser-accepted length field.

The on-the-wire DNODE header carries mlen and plen as ASCII decimal numerals that the streaming parser accumulates into a u64 before casting to the wire’s u32. Without an explicit cap on the accumulator, a single byte run of 1s inflates self.num past u32::MAX; the silent truncation then drives Vec::reserve into a multi-gigabyte malloc (libfuzzer 1h soak finding 2026-06-02, captured at crates/fuzz/seeds/dnode_parse/regression-oom-2026-06-02).

256 MiB is well above any legitimate DNODE frame on the wire today (the largest production payloads we have observed are a few hundred KiB) while staying well below an allocation that would produce a real OOM under typical RSS budgets. The parser surfaces ParseStep::Error the moment any DataLen or PayloadLen accumulator exceeds this bound.