Skip to main content

MAX_READ_DEPTH

Constant MAX_READ_DEPTH 

Source
pub const MAX_READ_DEPTH: usize = 64;
Expand description

Nesting the reader accepts before refusing the input.

parse_expr and parse_list are mutually recursive with a stack frame per level, so without a ceiling a few kilobytes of (((… aborts the whole process — and the reader is reachable from a report query parameter and from the SSH eval channel. Same purpose as MAX_SHARED_RECURSION_DEPTH.

64 is measured, not guessed: on a 2 MiB stack (the default for both tokio workers and libtest threads) a debug build survives 128 levels and aborts at 192, so this keeps a 2x margin — and is still far more nesting than any real filter or program.