Assert that reloc section completely uses up the custom section payload.

This commit is contained in:
Arnavion
2018-03-07 21:23:39 -08:00
parent 0ab2aa15b2
commit 653ba50200

View File

@@ -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 {