Skip to content

Commit

Permalink
another off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
jrouaix committed Aug 9, 2024
1 parent 07b0eb4 commit d276842
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/decoders/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ pub(crate) fn check_objects(
let mut index = item_index;
let precision_item = 0x12;

if index >= message_values.len() {
return format!("Index out of bounds for FirehoseItemInfo Vec. Got adjusted index {}, Vec size is {}. This should not have happened", index, message_values.len());
}

// Increment index get the actual firehose item data
if item_type == &precision_item {
index += 1;
if index > message_values.len() {
if index >= message_values.len() {
return format!("Index out of bounds for FirehoseItemInfo Vec. Got adjusted index {}, Vec size is {}. This should not have happened", index, message_values.len());
}
}
Expand Down

0 comments on commit d276842

Please sign in to comment.