1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

reject under-length raw exif profile in processRawProfile

This commit is contained in:
uwezkhan
2026-06-13 15:04:24 +05:30
parent cadcb7e4e0
commit 19ec7ea28b
+6
View File
@@ -160,6 +160,12 @@ bool ExifReader::processRawProfile(const char* profile, size_t profile_len) {
}
++end;
// the payload starts with a 6-byte "Exif\0\0" header, so a shorter declared
// length underflows the size and pointer handed to parseExif() below
if (expected_length < 6) {
return false;
}
// 'end' now points to the profile payload.
std::string payload = HexStringToBytes(end, expected_length);
if (payload.size() == 0) return false;