Skip to content

Commit 99059c4

Browse files
rbranWeitao-Sun
authored andcommitted
fix PEView::Init divide by zero FPE
1 parent 174120f commit 99059c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

view/pe/peview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ bool PEView::Init()
783783
else
784784
{
785785
uint64_t sizeOfImage = opt.sizeOfImage;
786-
if (opt.sizeOfImage % resolvedSectionAlignment)
786+
if (resolvedSectionAlignment && opt.sizeOfImage % resolvedSectionAlignment)
787787
sizeOfImage = (opt.sizeOfImage + resolvedSectionAlignment) & ~(resolvedSectionAlignment - 1);
788788
uint64_t dataLength = GetParentView()->GetEnd();
789789
dataLength = std::min(std::max((uint64_t)m_sizeOfHeaders, sizeOfImage), dataLength);

0 commit comments

Comments
 (0)