[*] sanitize these AuByteBuffer utilities to prevent exploitation

This commit is contained in:
Reece Wilson 2023-04-29 07:38:16 +01:00
parent cc317882e9
commit e4e3e70be2

View File

@ -203,6 +203,16 @@ namespace Aurora::Memory
pBase = this->readPtr;
}
if (pBase + uCount > this->base + this->length)
{
return {};
}
if (pBase < this->base)
{
return {};
}
return MemoryViewRead(pBase, uCount);
}
@ -241,6 +251,16 @@ namespace Aurora::Memory
pBase = this->writePtr;
}
if (pBase + uCount > this->base + this->length)
{
return {};
}
if (pBase < this->base)
{
return {};
}
return MemoryViewWrite(pBase, uCount);
}