pattern: Don't allow negative array sizes
This commit is contained in:
parent
0e40b8a81a
commit
b4a3eb240e
@ -969,7 +969,7 @@ namespace hex::pl {
|
|||||||
|
|
||||||
evaluator->dataOffset() = startOffset;
|
evaluator->dataOffset() = startOffset;
|
||||||
|
|
||||||
u128 entryCount = 0;
|
i128 entryCount = 0;
|
||||||
|
|
||||||
if (this->m_size != nullptr) {
|
if (this->m_size != nullptr) {
|
||||||
auto sizeNode = this->m_size->evaluate(evaluator);
|
auto sizeNode = this->m_size->evaluate(evaluator);
|
||||||
@ -988,6 +988,9 @@ namespace hex::pl {
|
|||||||
evaluator->handleAbort();
|
evaluator->handleAbort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entryCount < 0)
|
||||||
|
LogConsole::abortEvaluation("array cannot have a negative size", this);
|
||||||
} else {
|
} else {
|
||||||
std::vector<u8> buffer(templatePattern->getSize());
|
std::vector<u8> buffer(templatePattern->getSize());
|
||||||
while (true) {
|
while (true) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user