mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Add tests for SSZ offset attacks
This commit is contained in:
@@ -100,9 +100,14 @@ impl<'a> SszDecoderBuilder<'a> {
|
||||
|
||||
fn apply_offsets(&mut self) -> Result<(), DecodeError> {
|
||||
if !self.offsets.is_empty() {
|
||||
|
||||
let mut insertions = 0;
|
||||
let mut running_offset = self.offsets[0].offset;
|
||||
|
||||
if running_offset != self.items_index {
|
||||
return Err(DecodeError::OutOfBoundsByte { i: running_offset })
|
||||
}
|
||||
|
||||
for i in 1..=self.offsets.len() {
|
||||
let (slice_option, position) = if i == self.offsets.len() {
|
||||
(self.bytes.get(running_offset..), self.offsets.len())
|
||||
|
||||
Reference in New Issue
Block a user