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

4a042c
diff --git a/src/canonmn.cpp b/src/canonmn.cpp
4a042c
index 450c7d9..f768c05 100644
4a042c
--- a/src/canonmn.cpp
4a042c
+++ b/src/canonmn.cpp
4a042c
@@ -1774,9 +1774,13 @@ namespace Exiv2 {
4a042c
     {
4a042c
         try {
4a042c
             // 1140
4a042c
-            if( metadata->findKey(ExifKey("Exif.Image.Model"        ))->value().toString() == "Canon EOS 30D"
4a042c
-            &&  metadata->findKey(ExifKey("Exif.CanonCs.Lens"       ))->value().toString() == "24 24 1"
4a042c
-            &&  metadata->findKey(ExifKey("Exif.CanonCs.MaxAperture"))->value().toString() == "95" // F2.8
4a042c
+            const ExifData::const_iterator itModel = metadata->findKey(ExifKey("Exif.Image.Model"));
4a042c
+            const ExifData::const_iterator itLens  = metadata->findKey(ExifKey("Exif.CanonCs.Lens"));
4a042c
+            const ExifData::const_iterator itApert = metadata->findKey(ExifKey("Exif.CanonCs.MaxAperture"));
4a042c
+
4a042c
+            if( itModel != metadata->end() && itModel->value().toString() == "Canon EOS 30D"
4a042c
+            &&  itLens  != metadata->end() && itLens->value().toString() == "24 24 1"
4a042c
+            &&  itApert != metadata->end() && itApert->value().toString() == "95" // F2.8
4a042c
             ){
4a042c
                 return os << "Canon EF-S 24mm f/2.8 STM" ;
4a042c
             }