Use memmove, rather than memcpy, because memory regions might overlap.

This commit is contained in:
Kevin Backhouse 2021-12-13 12:22:54 +00:00
parent 4aa701f47f
commit e34eacc467
No known key found for this signature in database
GPG Key ID: 9DD01852EE40366E

View File

@ -745,7 +745,7 @@ namespace Exiv2 {
#endif
memset(buf + 8, 0x0, 4);
if (pTiffEntry->size() > 0) {
memcpy(buf + 8, pTiffEntry->pData(), pTiffEntry->size());
memmove(buf + 8, pTiffEntry->pData(), pTiffEntry->size());
memset(const_cast<byte*>(pTiffEntry->pData()), 0x0, pTiffEntry->size());
}
}