[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:42:54 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=6233fa6

The following commit has been merged in the master branch:
commit 6233fa693060a8b3a6ce328d34c8bbf6f88a2a0d
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Fri Feb 17 15:51:46 2012 +0000

    #810: Added sanity-checks for the minimum size of IFD makernotes before parsing.
---
 src/makernote.cpp     | 215 ++++++++++++++++++++++++++++++++------------------
 src/makernote_int.hpp |  18 ++---
 2 files changed, 148 insertions(+), 85 deletions(-)

diff --git a/src/makernote.cpp b/src/makernote.cpp
index 4df3fa8..3a83183 100644
--- a/src/makernote.cpp
+++ b/src/makernote.cpp
@@ -162,11 +162,15 @@ namespace Exiv2 {
     const byte OlympusMnHeader::signature_[] = {
         'O', 'L', 'Y', 'M', 'P', 0x00, 0x01, 0x00
     };
-    const uint32_t OlympusMnHeader::size_ = 8;
+
+    uint32_t OlympusMnHeader::sizeOfSignature()
+    {
+        return sizeof(signature_);
+    }
 
     OlympusMnHeader::OlympusMnHeader()
     {
-        read(signature_, size_, invalidByteOrder);
+        read(signature_, sizeOfSignature(), invalidByteOrder);
     }
 
     OlympusMnHeader::~OlympusMnHeader()
@@ -180,17 +184,17 @@ namespace Exiv2 {
 
     uint32_t OlympusMnHeader::ifdOffset() const
     {
-        return size_;
+        return sizeOfSignature();
     }
 
     bool OlympusMnHeader::read(const byte* pData,
                                uint32_t size,
                                ByteOrder /*byteOrder*/)
     {
-        if (!pData || size < size_) return false;
-        header_.alloc(size_);
+        if (!pData || size < sizeOfSignature()) return false;
+        header_.alloc(sizeOfSignature());
         std::memcpy(header_.pData_, pData, header_.size_);
-        if (   static_cast<uint32_t>(header_.size_) < size_
+        if (   static_cast<uint32_t>(header_.size_) < sizeOfSignature()
             || 0 != memcmp(header_.pData_, signature_, 6)) {
             return false;
         }
@@ -200,18 +204,22 @@ namespace Exiv2 {
     uint32_t OlympusMnHeader::write(IoWrapper& ioWrapper,
                                     ByteOrder /*byteOrder*/) const
     {
-        ioWrapper.write(signature_, size_);
-        return size_;
+        ioWrapper.write(signature_, sizeOfSignature());
+        return sizeOfSignature();
     } // OlympusMnHeader::write
 
     const byte Olympus2MnHeader::signature_[] = {
         'O', 'L', 'Y', 'M', 'P', 'U', 'S', 0x00, 'I', 'I', 0x03, 0x00
     };
-    const uint32_t Olympus2MnHeader::size_ = 12;
+
+    uint32_t Olympus2MnHeader::sizeOfSignature()
+    {
+        return sizeof(signature_);
+    }
 
     Olympus2MnHeader::Olympus2MnHeader()
     {
-        read(signature_, size_, invalidByteOrder);
+        read(signature_, sizeOfSignature(), invalidByteOrder);
     }
 
     Olympus2MnHeader::~Olympus2MnHeader()
@@ -225,7 +233,7 @@ namespace Exiv2 {
 
     uint32_t Olympus2MnHeader::ifdOffset() const
     {
-        return size_;
+        return sizeOfSignature();
     }
 
     uint32_t Olympus2MnHeader::baseOffset(uint32_t mnOffset) const
@@ -237,10 +245,10 @@ namespace Exiv2 {
                                 uint32_t size,
                                 ByteOrder /*byteOrder*/)
     {
-        if (!pData || size < size_) return false;
-        header_.alloc(size_);
+        if (!pData || size < sizeOfSignature()) return false;
+        header_.alloc(sizeOfSignature());
         std::memcpy(header_.pData_, pData, header_.size_);
-        if (   static_cast<uint32_t>(header_.size_) < size_
+        if (   static_cast<uint32_t>(header_.size_) < sizeOfSignature()
             || 0 != memcmp(header_.pData_, signature_, 10)) {
             return false;
         }
@@ -250,19 +258,23 @@ namespace Exiv2 {
     uint32_t Olympus2MnHeader::write(IoWrapper& ioWrapper,
                                     ByteOrder /*byteOrder*/) const
     {
-        ioWrapper.write(signature_, size_);
-        return size_;
+        ioWrapper.write(signature_, sizeOfSignature());
+        return sizeOfSignature();
     } // Olympus2MnHeader::write
 
     const byte FujiMnHeader::signature_[] = {
         'F', 'U', 'J', 'I', 'F', 'I', 'L', 'M', 0x0c, 0x00, 0x00, 0x00
     };
-    const uint32_t FujiMnHeader::size_ = 12;
     const ByteOrder FujiMnHeader::byteOrder_ = littleEndian;
 
+    uint32_t FujiMnHeader::sizeOfSignature()
+    {
+        return sizeof(signature_);
+    }
+
     FujiMnHeader::FujiMnHeader()
     {
-        read(signature_, size_, byteOrder_);
+        read(signature_, sizeOfSignature(), byteOrder_);
     }
 
     FujiMnHeader::~FujiMnHeader()
@@ -293,13 +305,13 @@ namespace Exiv2 {
                             uint32_t size,
                             ByteOrder /*byteOrder*/)
     {
-        if (!pData || size < size_) return false;
-        header_.alloc(size_);
+        if (!pData || size < sizeOfSignature()) return false;
+        header_.alloc(sizeOfSignature());
         std::memcpy(header_.pData_, pData, header_.size_);
         // Read offset to the IFD relative to the start of the makernote
         // from the header. Note that we ignore the byteOrder argument
         start_ = getULong(header_.pData_ + 8, byteOrder_);
-        if (   static_cast<uint32_t>(header_.size_) < size_
+        if (   static_cast<uint32_t>(header_.size_) < sizeOfSignature()
             || 0 != memcmp(header_.pData_, signature_, 8)) {
             return false;
         }
@@ -309,18 +321,22 @@ namespace Exiv2 {
     uint32_t FujiMnHeader::write(IoWrapper& ioWrapper,
                                  ByteOrder /*byteOrder*/) const
     {
-        ioWrapper.write(signature_, size_);
-        return size_;
+        ioWrapper.write(signature_, sizeOfSignature());
+        return sizeOfSignature();
     } // FujiMnHeader::write
 
     const byte Nikon2MnHeader::signature_[] = {
         'N', 'i', 'k', 'o', 'n', '

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list