Blame SOURCES/exiv2-CVE-2018-5772.patch

4a042c
diff --git a/src/cr2image.cpp b/src/cr2image.cpp
4a042c
index 2907426..b6fa315 100644
4a042c
--- a/src/cr2image.cpp
4a042c
+++ b/src/cr2image.cpp
4a042c
@@ -107,8 +107,6 @@ namespace Exiv2 {
4a042c
             throw Error(3, "CR2");
4a042c
         }
4a042c
         clearMetadata();
4a042c
-        std::ofstream devnull;
4a042c
-        printStructure(devnull, kpsRecursive, 0);
4a042c
         ByteOrder bo = Cr2Parser::decode(exifData_,
4a042c
                                          iptcData_,
4a042c
                                          xmpData_,
4a042c
diff --git a/src/crwimage.cpp b/src/crwimage.cpp
4a042c
index ca79aa7..11cd14c 100644
4a042c
--- a/src/crwimage.cpp
4a042c
+++ b/src/crwimage.cpp
4a042c
@@ -131,15 +131,8 @@ namespace Exiv2 {
4a042c
             throw Error(33);
4a042c
         }
4a042c
         clearMetadata();
4a042c
-        // read all metadata into memory
4a042c
-        // we should put this into clearMetadata(), however it breaks the test suite!
4a042c
-        try {
4a042c
-            std::ofstream devnull;
4a042c
-            printStructure(devnull,kpsRecursive,0);
4a042c
-        } catch (Exiv2::Error& /* e */) {
4a042c
-            DataBuf file(io().size());
4a042c
-            io_->read(file.pData_,file.size_);
4a042c
-        }
4a042c
+        DataBuf file( (long) io().size());
4a042c
+        io_->read(file.pData_,file.size_);
4a042c
 
4a042c
         CrwParser::decode(this, io_->mmap(), io_->size());
4a042c
 
4a042c
diff --git a/src/orfimage.cpp b/src/orfimage.cpp
4a042c
index c516591..9a17a50 100644
4a042c
--- a/src/orfimage.cpp
4a042c
+++ b/src/orfimage.cpp
4a042c
@@ -119,8 +119,6 @@ namespace Exiv2 {
4a042c
             throw Error(3, "ORF");
4a042c
         }
4a042c
         clearMetadata();
4a042c
-        std::ofstream devnull;
4a042c
-        printStructure(devnull, kpsRecursive, 0);
4a042c
         ByteOrder bo = OrfParser::decode(exifData_,
4a042c
                                          iptcData_,
4a042c
                                          xmpData_,
4a042c
diff --git a/src/rw2image.cpp b/src/rw2image.cpp
4a042c
index 95f3b28..764de6f 100644
4a042c
--- a/src/rw2image.cpp
4a042c
+++ b/src/rw2image.cpp
4a042c
@@ -130,8 +130,6 @@ namespace Exiv2 {
4a042c
             throw Error(3, "RW2");
4a042c
         }
4a042c
         clearMetadata();
4a042c
-        std::ofstream devnull;
4a042c
-        printStructure(devnull, kpsRecursive, 0);
4a042c
         ByteOrder bo = Rw2Parser::decode(exifData_,
4a042c
                                          iptcData_,
4a042c
                                          xmpData_,
4a042c
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
4a042c
index f20c69e..9e6eda4 100644
4a042c
--- a/src/tiffimage.cpp
4a042c
+++ b/src/tiffimage.cpp
4a042c
@@ -185,10 +185,6 @@ namespace Exiv2 {
4a042c
         }
4a042c
         clearMetadata();
4a042c
 
4a042c
-        // recursively print the structure to /dev/null to ensure all metadata is in memory
4a042c
-        // must be recursive to handle NEFs which stores the raw image in a subIFDs
4a042c
-        std::ofstream devnull;
4a042c
-        printStructure(devnull,kpsRecursive,0);
4a042c
         ByteOrder bo = TiffParser::decode(exifData_,
4a042c
                                           iptcData_,
4a042c
                                           xmpData_,