Skip to content

Index out of bounds when printing JSON of ProcessState #440

@ghost

Description

I made the minidump_processor fuzzer look more like

let val: Result<_, _> = minidump_processor_fuzz::fuzzing_block_on(
    minidump_processor::process_minidump(&dump, &provider),
);
                                                                   
if let Ok(v) = val {
    v.print_json(&mut std::io::sink(), true);
}

And then found this:

thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/jess/src/rust-minidump/minidump-processor/src/process_state.rs:806:45
stack backtrace:
   0: rust_begin_unwind
             at /rustc/88fb06a1f331926bccb448acdb52966fd1ec8a92/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/88fb06a1f331926bccb448acdb52966fd1ec8a92/library/core/src/panicking.rs:135:14
   2: core::panicking::panic_bounds_check
             at /rustc/88fb06a1f331926bccb448acdb52966fd1ec8a92/library/core/src/panicking.rs:77:5
   3: minidump_processor::process_state::ProcessState::print_json
   4: rust_fuzzer_test_input
   5: LLVMFuzzerTestOneInput
   6: _ZN6fuzzer6Fuzzer15ExecuteCallbackEPKhm
   7: _ZN6fuzzer10RunOneTestEPNS_6FuzzerEPKcm
   8: _ZN6fuzzer12FuzzerDriverEPiPPPcPFiPKhmE
   9: main
  10: __libc_start_main
  11: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
==3765619== ERROR: libFuzzer: deadly signal
NOTE: libFuzzer has rudimentary signal handlers.
      Combine libFuzzer with AddressSanitizer or similar for better crash reports.
SUMMARY: libFuzzer: deadly signal

json-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