We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b22cdb7 commit f7a866aCopy full SHA for f7a866a
src/parser/mrt/messages/table_dump_v2/rib_afi_entries.rs
@@ -62,7 +62,8 @@ pub fn parse_rib_afi_entries(
62
63
let entry_count = data.read_u16()?;
64
// Pre-allocate cautiously to avoid overflow/OOM with malformed inputs
65
- let min_entry_size = 2 /*peer_index*/ + 4 /*time*/ + 2 /*attr_len*/ + if is_add_path { 4 } else { 0 };
+ let min_entry_size =
66
+ 2 /*peer_index*/ + 4 /*time*/ + 2 /*attr_len*/ + if is_add_path { 4 } else { 0 };
67
let max_possible = data.remaining() / min_entry_size;
68
let reserve = (entry_count as usize).min(max_possible).saturating_mul(2);
69
let mut rib_entries = Vec::with_capacity(reserve);
0 commit comments