Skip to main content

MAX_FRAME_LEN

Constant MAX_FRAME_LEN 

Source
pub const MAX_FRAME_LEN: usize = _; // 268_435_456usize
Expand description

Hard cap on a single frame’s payload (256 MiB). A plugin is an untrusted peer over the wire: the 4-byte length prefix is attacker-controlled and a hostile/buggy plugin could send 0xFFFF_FFFF to make the daemon allocate 4 GiB and OOM. We refuse any frame larger than this before allocating. 256 MiB comfortably exceeds the largest realistic ParseOutput/InvokeResponse.