mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Fix panic parsing CSIs
The array lengths were transposed, so attempting to parse a CSI with more than 4 parameters would go out of bounds and panic.
This commit is contained in:
parent
1b644226ec
commit
21860cbd39
1 changed files with 1 additions and 1 deletions
|
@ -806,7 +806,7 @@ pub trait InputEventQueuer {
|
||||||
|
|
||||||
fn parse_csi(&mut self, buffer: &mut Vec<u8>) -> Option<Key> {
|
fn parse_csi(&mut self, buffer: &mut Vec<u8>) -> Option<Key> {
|
||||||
let mut next_char = |zelf: &mut Self| zelf.try_readb(buffer).unwrap_or(0xff);
|
let mut next_char = |zelf: &mut Self| zelf.try_readb(buffer).unwrap_or(0xff);
|
||||||
let mut params = [[0_u32; 16]; 4];
|
let mut params = [[0_u32; 4]; 16];
|
||||||
let mut c = next_char(self);
|
let mut c = next_char(self);
|
||||||
let private_mode;
|
let private_mode;
|
||||||
if matches!(c, b'?' | b'<' | b'=' | b'>') {
|
if matches!(c, b'?' | b'<' | b'=' | b'>') {
|
||||||
|
|
Loading…
Reference in a new issue