check offset in ExifReader::getString
This commit is contained in:
parent
b4112a5878
commit
933dfed4b8
@ -401,6 +401,9 @@ std::string ExifReader::getString(const size_t offset) const
|
|||||||
{
|
{
|
||||||
dataOffset = getU32( offset + 8 );
|
dataOffset = getU32( offset + 8 );
|
||||||
}
|
}
|
||||||
|
if (dataOffset > m_data.size() || dataOffset + size > m_data.size()) {
|
||||||
|
throw ExifParsingError();
|
||||||
|
}
|
||||||
std::vector<uint8_t>::const_iterator it = m_data.begin() + dataOffset;
|
std::vector<uint8_t>::const_iterator it = m_data.begin() + dataOffset;
|
||||||
std::string result( it, it + size ); //copy vector content into result
|
std::string result( it, it + size ); //copy vector content into result
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user