improvements for issue #208
This commit is contained in:
parent
dba9fba725
commit
421c6d6723
@ -5,6 +5,7 @@
|
||||
#include <limits>
|
||||
|
||||
#include "exif.hpp"
|
||||
#include "error.hpp"
|
||||
#include "image_int.hpp"
|
||||
|
||||
|
||||
@ -107,7 +108,7 @@ namespace Exiv2
|
||||
}
|
||||
else
|
||||
{
|
||||
byte buffer[8];
|
||||
byte buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
io.read(buffer, 2);
|
||||
const int size = getUShort(buffer, byteOrder);
|
||||
|
||||
@ -118,8 +119,13 @@ namespace Exiv2
|
||||
io.read(buffer, 8);
|
||||
const uint64_t offset = getULongLong(buffer, byteOrder);
|
||||
|
||||
if (offset >= io.size())
|
||||
throw Exiv2::Error(58);
|
||||
|
||||
result = Header(byteOrder, magic, size, offset);
|
||||
}
|
||||
else
|
||||
throw Exiv2::Error(58);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@ -11,6 +11,6 @@ class CVE_2017_14857(system_tests.Case):
|
||||
stdout = [""]
|
||||
stderr = [
|
||||
"""{exiv2_exception_msg} """ + filename + """:
|
||||
""" + filename + """: The file contains data of an unknown image type"""
|
||||
]
|
||||
{error_58_message}
|
||||
"""]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user