mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 05:03:46 +08: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
|
@ -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 New Issue
Block a user