diff --git a/core/src-c/memory.c b/core/src-c/memory.c index 051d058..b689529 100644 --- a/core/src-c/memory.c +++ b/core/src-c/memory.c @@ -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;