alacritty / vte

Parser for virtual terminal emulators
https://docs.rs/vte/
Apache License 2.0
242 stars 56 forks source link

Out of bounds panic in vte::Parser::perform_action #50

Closed xTibor closed 4 years ago

xTibor commented 4 years ago

Found with afl.rs.

Stacktrace:

thread 'pty reader' panicked at 'index out of bounds: the len is 16 but the index is 16', /home/tibor/.cargo/registry/src/github.com-1ecc6299db9ec823/vte-0.7.0/src/lib.rs:205:17
stack backtrace:
  ...
  11: rust_begin_unwind
             at src/libstd/panicking.rs:375
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:84
  13: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:62
  14: vte::Parser::perform_action
             at /home/tibor/.cargo/registry/src/github.com-1ecc6299db9ec823/vte-0.7.0/src/lib.rs:205
  15: vte::Parser::perform_state_change
             at /home/tibor/.cargo/registry/src/github.com-1ecc6299db9ec823/vte-0.7.0/src/lib.rs:151
  16: vte::Parser::advance
             at /home/tibor/.cargo/registry/src/github.com-1ecc6299db9ec823/vte-0.7.0/src/lib.rs:128
  17: alacritty_terminal::ansi::Processor::advance
             at ./alacritty_terminal/src/ansi.rs:141
  18: alacritty_terminal::event_loop::EventLoop<T,U>::pty_read
             at ./alacritty_terminal/src/event_loop.rs:245
  19: alacritty_terminal::event_loop::EventLoop<T,U>::spawn::{{closure}}
             at ./alacritty_terminal/src/event_loop.rs:364

Test case: Unminimized test case: test.vte.zip