Use memmove instead of memcpy with overlapping arguments. Patch from Adrian Immanuel Kiess in PR pkg/55809.