Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic on attempt to multiply with overflow #1

Open
daniellockyer opened this issue Jul 7, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@daniellockyer
Copy link

commented Jul 7, 2019

Found using cargo-fuzz.

Input:

\x8a\x8f\xff`J\xb4\xc0

Test program:

extern crate adsb;

fn main() {
    let data : &[u8] = b"\x8a\x8f\xff`J\xb4\xc0";
    let _ = adsb::parse_binary(data);
}
thread 'main' panicked at 'attempt to multiply with overflow', src/parser.rs:44:10
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::panicking::panic
             at src/libcore/panicking.rs:49
  11: adsb::parser::parse_altitude
             at src/parser.rs:44
  12: adsb::parser::parse_airborne_position
             at ./<::nom::macros::named macros>:13
  13: adsb::parser::parse_adsb_message_kind
             at ./<::nom::macros::named macros>:13
  14: adsb::parser::parse_adsb_message
             at ./<::nom::macros::named macros>:13
  15: adsb::parser::parse_message_kind
             at ./<::nom::macros::named macros>:13
  16: adsb::parser::parse_message
             at ./<::nom::macros::named macros>:13
  17: adsb::parser::parse_binary
             at src/parser.rs:181
  18: a::main
             at examples/a.rs:5
  19: std::rt::lang_start::{{closure}}
             at /rustc/17e62f77f954bed97aae839624bfd6dd68342daf/src/libstd/rt.rs:64
  20: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  21: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  22: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:82
  23: std::panicking::try
             at src/libstd/panicking.rs:275
  24: std::panic::catch_unwind
             at src/libstd/panic.rs:388
  25: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  26: std::rt::lang_start
             at /rustc/17e62f77f954bed97aae839624bfd6dd68342daf/src/libstd/rt.rs:64
  27: main
  28: __libc_start_main
  29: _start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.