add additional check for BPDT store size

This commit is contained in:
yeggor 2023-07-18 17:25:52 +04:00 committed by Nikolaj Schlej
parent a5675bda90
commit 036be8d3bc

View File

@ -1403,8 +1403,10 @@ continue_searching: {}
} }
// Check size candidate // Check size candidate
if (sizeCandidate == 0) if (sizeCandidate == 0 || sizeCandidate > restSize) {
msg(usprintf("%s: invalid BpdtStore size (sizeCandidate = 0x%x, restSize = 0x%x)", __FUNCTION__, sizeCandidate, restSize), index);
continue; continue;
}
// All checks passed, BPDT found // All checks passed, BPDT found
nextItemType = Types::BpdtStore; nextItemType = Types::BpdtStore;