Skip to content

Commit

Permalink
fix: integer overflow in pe module
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Nov 15, 2023
1 parent a85b9cb commit d0b2756
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yara-x/src/modules/pe/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl<'a> PE<'a> {
return None;
}

let result = section_offset + rva - section_rva;
let result = section_offset.saturating_add(rva - section_rva);

// Make sure the resulting offset is within the file.
if result as usize >= self.data.len() {
Expand Down

0 comments on commit d0b2756

Please sign in to comment.