memcpy() is not safe if source and destination are overlapping.

This commit is contained in:
Moritz Bunkus 2004-12-21 18:20:55 +00:00
parent 3d4e11c12a
commit 6b23fb887e

View File

@ -64,9 +64,8 @@ read_next_header(mm_io_c *mm_io,
while (1) { while (1) {
if (sp < ep) { if (sp < ep) {
bleft = ep - sp; bleft = ep - sp;
memcpy(buffer, sp, bleft); memmove(buffer, sp, bleft);
} } else
else
bleft = 0; bleft = 0;
if (mm_io->read(buffer + bleft, sizeof(*wphdr) - bleft) != if (mm_io->read(buffer + bleft, sizeof(*wphdr) - bleft) !=