Skip to content

Recursion causes stack overflow which aborts process #121

@ghost

Description

Trying to parse the following pdf contained within the zip file will cause a stack overflow.

The fuzzing harness I used to find this was modified from the existing one, since there's already lots of panics and I wanted to look for more interesting bugs.

#![no_main]
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
    std::panic::set_hook(Box::new(|_| {}));

    std::panic::catch_unwind(|| {
        if let Ok(p) = pdf::file::File::from_data(data) {
            for _ in p.pages() {}
        }
    });
});

crash.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions