String.h
Some checks failed
Build Dusk / run-tests (push) Successful in 2m2s
Build Dusk / build-linux (push) Successful in 2m1s
Build Dusk / build-psp (push) Failing after 1m21s

This commit is contained in:
2026-01-05 17:20:17 -06:00
parent a793ac2ff7
commit 83b799caa8
7 changed files with 1007 additions and 18 deletions

View File

@@ -27,6 +27,14 @@ void memoryCopy(void *dest, const void *src, const size_t size) {
assertNotNull(src, "Cannot copy from NULL memory.");
assertTrue(size > 0, "Cannot copy 0 bytes of memory.");
assertTrue(dest != src, "Cannot copy memory to itself.");
// Check for overlapping regions
assertTrue(
((uint8_t*)dest + size <= (uint8_t*)src) ||
((uint8_t*)src + size <= (uint8_t*)dest),
"Source and destination memory regions overlap."
);
memcpy(dest, src, size);
}