mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
pattern: Don't allow negative array sizes
This commit is contained in:
@@ -969,7 +969,7 @@ namespace hex::pl {
|
||||
|
||||
evaluator->dataOffset() = startOffset;
|
||||
|
||||
u128 entryCount = 0;
|
||||
i128 entryCount = 0;
|
||||
|
||||
if (this->m_size != nullptr) {
|
||||
auto sizeNode = this->m_size->evaluate(evaluator);
|
||||
@@ -988,6 +988,9 @@ namespace hex::pl {
|
||||
evaluator->handleAbort();
|
||||
}
|
||||
}
|
||||
|
||||
if (entryCount < 0)
|
||||
LogConsole::abortEvaluation("array cannot have a negative size", this);
|
||||
} else {
|
||||
std::vector<u8> buffer(templatePattern->getSize());
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user