Skip to content

Commit

Permalink
pe: fix certificate table parsing
Browse files Browse the repository at this point in the history
There appear to be an off-by-one error in the parsing of the certificate
table. This error would occur when the cert table is at the end of the
binary.
  • Loading branch information
baloo authored and m4b committed Mar 13, 2023
1 parent 170395f commit d7e8e29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pe/certificate_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub(crate) fn enumerate_certificates(
let mut attrs = vec![];

// End offset cannot be further than the binary we have at hand.
if table_end_offset >= bytes.len() {
if table_end_offset > bytes.len() {
return Err(error::Error::Malformed(
"End of attribute certificates table is after the end of the PE binary".to_string(),
));
Expand Down

0 comments on commit d7e8e29

Please sign in to comment.