mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-07-31 22:31:59 +00:00
Assert that reloc section completely uses up the custom section payload.
This commit is contained in:
@@ -208,6 +208,10 @@ impl Module {
|
||||
Ok(reloc_section) => reloc_section,
|
||||
Err(e) => { parse_errors.push((i, e)); continue; }
|
||||
};
|
||||
if rdr.position() != custom.payload().len() as u64 {
|
||||
parse_errors.push((i, io::Error::from(io::ErrorKind::InvalidData).into()));
|
||||
continue;
|
||||
}
|
||||
Some(Section::Reloc(reloc_section))
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user