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

fix some more overflow panics

This commit is contained in:
Robin Appelman 2020-01-20 21:07:32 +01:00
commit 66d568a65f
3 changed files with 3 additions and 4 deletions

View file

@ -62,7 +62,6 @@ impl Parse for GameEventMessage {
}
}
None => {
dbg!(state.event_definitions.len());
return Err(ParseError::MalformedGameEvent(GameEventError::UnknownType(
event_type,
)));

View file

@ -235,11 +235,11 @@ impl PacketEntitiesMessage {
send_table: &SendTable,
props: &mut Vec<SendProp>,
) -> Result<()> {
let mut index = -1;
let mut index: i32 = -1;
while stream.read()? {
let diff: u32 = read_bit_var(stream)?;
index += (diff as i32) + 1;
index = index.saturating_add(diff as i32).saturating_add(1);
match send_table.flattened_props.get(index as usize) {
Some(definition) => {