Skip to content

Commit d00ce6f

Browse files
authored
Merge pull request #827 from avast/bug-upx-crash-821
Fix crash on samples having corrupted PE header (#821)
2 parents 39cb314 + b35bf1c commit d00ce6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cpdetect/heuristics/pe_heuristics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ void PeHeuristics::getUpxHeuristics()
937937
// format: x.xx'\0'UPX!
938938
const std::size_t minPos = 5, verLen = 4;
939939
pos = content.find("UPX!");
940-
if (pos >= minPos && pos < 0x500 && pos < sections[0]->getOffset())
940+
if (pos >= minPos && pos < 0x500 && !sections.empty() && pos < sections[0]->getOffset())
941941
{
942942
std::string version;
943943
std::size_t num;

0 commit comments

Comments
 (0)