Skip to content

Commit

Permalink
pe.utils: handle case when section raw_data is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ideeockus committed Mar 13, 2024
1 parent d73a80a commit 06cf965
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pe/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ fn section_read_size(section: &section_table::SectionTable, file_alignment: u32)

if virtual_size == 0 {
read_size
} else if size_of_raw_data == 0 {
virtual_size
} else {
cmp::min(read_size, round_size(virtual_size))
}
Expand Down

0 comments on commit 06cf965

Please sign in to comment.