From 8f0ac7ceeeb47c93ee7cc3d19a2053406abddf98 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 1 Mar 2020 11:15:37 +0000 Subject: [PATCH] Memory overlap fix proposal. --- Sources/AngelScript/addons/scriptarray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AngelScript/addons/scriptarray.cpp b/Sources/AngelScript/addons/scriptarray.cpp index 430caa101..3da5fba13 100755 --- a/Sources/AngelScript/addons/scriptarray.cpp +++ b/Sources/AngelScript/addons/scriptarray.cpp @@ -664,7 +664,7 @@ void CScriptArray::RemoveRange(asUINT start, asUINT count) // Compact the elements // As objects in arrays of objects are not stored inline, it is safe to use memmove here // since we're just copying the pointers to objects and not the actual objects. - memcpy(buffer->data + start*elementSize, buffer->data + (start + count)*elementSize, (buffer->numElements - count)*elementSize); + memmove(buffer->data + start*elementSize, buffer->data + (start + count)*elementSize, (buffer->numElements - count)*elementSize); buffer->numElements -= count; }