From 06cf965e4243861e6d26927136daa2dfe5c1fd47 Mon Sep 17 00:00:00 2001 From: ideeockus Date: Wed, 13 Mar 2024 22:17:46 +0300 Subject: [PATCH] pe.utils: handle case when section raw_data is zero --- src/pe/utils.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pe/utils.rs b/src/pe/utils.rs index 289ccc529..ad5746851 100644 --- a/src/pe/utils.rs +++ b/src/pe/utils.rs @@ -64,6 +64,8 @@ fn section_read_size(section: §ion_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)) }