mirror of
https://github.com/wez/wezterm.git
synced 2024-09-20 11:17:15 +03:00
Avoid index OOB when parsing ITermFileData
This commit is contained in:
parent
2c84ddf4ba
commit
9b39d69927
@ -881,8 +881,12 @@ impl ITermFileData {
|
||||
let last = osc.len() - 1;
|
||||
for (idx, s) in osc.iter().enumerate().skip(1) {
|
||||
let param = if idx == 1 {
|
||||
// skip over File=
|
||||
&s[5..]
|
||||
if s.len() >= 5 {
|
||||
// skip over File=
|
||||
&s[5..]
|
||||
} else {
|
||||
bail!("failed to parse file data; File= not found");
|
||||
}
|
||||
} else {
|
||||
s
|
||||
};
|
||||
|
@ -839,4 +839,10 @@ mod test {
|
||||
actions
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn itermfiledata_oob() {
|
||||
let mut p = Parser::new();
|
||||
p.parse_as_vec(b"\x9d1337\xff;File\x1b");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user