Limit deserialization of data coming off the wire (#6751)
* Limit deserialization of data coming off the wire * Feedback and cleanup
This commit is contained in:
@ -115,7 +115,9 @@ impl Shred {
|
||||
where
|
||||
T: Deserialize<'de>,
|
||||
{
|
||||
let ret = bincode::deserialize(&buf[*index..*index + size])?;
|
||||
let ret = bincode::config()
|
||||
.limit(PACKET_DATA_SIZE as u64)
|
||||
.deserialize(&buf[*index..*index + size])?;
|
||||
*index += size;
|
||||
Ok(ret)
|
||||
}
|
||||
|
Reference in New Issue
Block a user