Fixed a logic bug in the memory overlap check function

This commit is contained in:
Eric-Paul Ickhorn 2023-12-12 23:33:26 +01:00
parent cd6d0773b3
commit c8ae7a57d1
Signed by: epickh
GPG Key ID: F5EBBE013924D95F
1 changed files with 2 additions and 0 deletions

View File

@ -14,10 +14,12 @@ bool_t rr_mem_overlap(void *block1, usz_t length1, void *block2, usz_t length2)
}
usz_t start1 = (usz_t) block1;
usz_t start2 = (usz_t) block2;
usz_t end1 = start1 + length1;
usz_t end2 = start2 + length2;
if(end2 > start1)
{
if(start2 > end1) return FALSE;
return TRUE;
}
return FALSE;