1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fixed some edge cases in write-past-end detection

This commit is contained in:
Brian Fiete 2022-06-02 15:01:02 -07:00
parent fd92b4ba93
commit 53376f3861
2 changed files with 3 additions and 2 deletions

View file

@ -632,7 +632,7 @@ void BfRawFree(void* ptr)
}
int markOffset = *markOffsetPtr;
if ((markOffset < 2) || (markOffset >= allocSize) || (markOffset >= kPageSize) ||
if ((markOffset < 2) || (markOffset >= allocSize) || (markOffset > kPageSize + 2) ||
(*(uint16*)((uint8*)markOffsetPtr - markOffset) != 0xBFBF))
{
int requestedSize = (uint8*)markOffsetPtr - (uint8*)ptr - markOffset;