Fix integer overflow.

main
Kevin Backhouse 4 years ago
parent c92ac88cb0
commit 9b7a19f957
No known key found for this signature in database
GPG Key ID: 9DD01852EE40366E

@ -1187,7 +1187,11 @@ namespace Exiv2 {
pCrwMapping->crwDir_);
if (edX != edEnd || edY != edEnd || edO != edEnd) {
uint32_t size = 28;
if (cc && cc->size() > size) size = cc->size();
if (cc) {
if (cc->size() < size)
throw Error(kerCorruptedMetadata);
size = cc->size();
}
DataBuf buf(size);
std::memset(buf.pData_, 0x0, buf.size_);
if (cc) std::memcpy(buf.pData_ + 8, cc->pData() + 8, cc->size() - 8);

Loading…
Cancel
Save