Blame SOURCES/exiv2-validation-of-size-and-offset-to-avoid-crash.patch

9b1eea
diff --git a/src/crwimage_int.cpp b/src/crwimage_int.cpp
9b1eea
index 29311fd..c0d9553 100644
9b1eea
--- a/src/crwimage_int.cpp
9b1eea
+++ b/src/crwimage_int.cpp
9b1eea
@@ -268,6 +268,9 @@ namespace Exiv2 {
9b1eea
 #ifdef EXIV2_DEBUG_MESSAGES
9b1eea
         std::cout << "Reading directory 0x" << std::hex << tag() << "\n";
9b1eea
 #endif
9b1eea
+        if (this->offset() + this->size() > size)
9b1eea
+            throw Error(kerOffsetOutOfRange);
9b1eea
+
9b1eea
         readDirectory(pData + offset(), this->size(), byteOrder);
9b1eea
 #ifdef EXIV2_DEBUG_MESSAGES
9b1eea
         std::cout << "<---- 0x" << std::hex << tag() << "\n";