Fix #562 for 32 bit builds (don't throw arithmetic exception).

This commit is contained in:
Robin Mills 2018-12-06 19:56:41 +00:00 committed by Luis Díaz Más
parent a33041a8b7
commit 88ec8b88ea

View File

@ -1523,7 +1523,7 @@ namespace Exiv2 {
if ((static_cast<uintptr_t>(baseOffset()) > std::numeric_limits<uintptr_t>::max() - static_cast<uintptr_t>(offset))
|| (static_cast<uintptr_t>(baseOffset() + offset) > std::numeric_limits<uintptr_t>::max() - reinterpret_cast<uintptr_t>(pData_)))
{
throw Error(kerArithmeticOverflow);
throw Error(kerCorruptedMetadata); // #562 don't throw kerArithmeticOverflow
}
if (pData_ + static_cast<uintptr_t>(baseOffset()) + static_cast<uintptr_t>(offset) > pLast_) {
throw Error(kerCorruptedMetadata);