1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 18:24:05 +02:00

fix panics with misformed demos and incorrect length values

This commit is contained in:
Robin Appelman 2020-01-19 20:25:13 +01:00
commit e77770c780
5 changed files with 502 additions and 2 deletions

View file

@ -97,7 +97,7 @@ pub struct PreFetchMessage {
pub struct MenuMessage {
pub kind: u16,
pub length: u16,
#[size = "length * 8"]
#[size = "length.saturating_mul(8)"]
pub index: Stream,
}
@ -111,6 +111,6 @@ pub struct GetCvarValueMessage {
#[endianness = "LittleEndian"]
pub struct CmdKeyValuesMessage {
pub length: u32,
#[size = "length * 8"]
#[size = "length.saturating_mul(8)"]
pub data: Stream,
}