We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0fed70 commit 2082edbCopy full SHA for 2082edb
1 file changed
Objects/obmalloc.c
@@ -363,6 +363,7 @@ _PyObject_MiRealloc(void *ctx, void *ptr, size_t nbytes)
363
_mi_memcpy((char*)newp + offset, (char*)ptr + offset, copy_size - offset);
364
}
365
else {
366
+ // memcpy(dst, NULL, 0) is undefined behavior. Guard against it.
367
if mi_likely(ptr) {
368
_mi_memcpy(newp, ptr, copy_size);
369
0 commit comments