Skip to content

Allocation limit #4

Description

@adamthedash

Parsers that can dynamically allocate RepeatVec, TakeVec, etc. can result in an OOM when ran on bad data. Introduce some global allocation limit such that when std::mem::size_of::<T> * N > LIMIT, parsing fails. The limit can be opt-in, defaulting to no limit. We'll have to account for nested heap-allocated types, such as u32::LE.repeat_vec(N).repeat_vec(M) somehow, or we can just opt for a single layer which will catch any extremely large N.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions