0f726d
From 487f4136013d9fa3351b863e5f861463a1cbddcf Mon Sep 17 00:00:00 2001
0f726d
From: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
0f726d
Date: Sat, 18 Aug 2018 13:54:55 +0000
0f726d
Subject: [PATCH] Issue #9 - Fix null-pointer-dereference (CVE-2018-12648)
0f726d
MIME-Version: 1.0
0f726d
Content-Type: text/plain; charset=UTF-8
0f726d
Content-Transfer-Encoding: 8bit
0f726d
0f726d
The WEBP::GetLE32 function in
0f726d
XMPFiles/source/FormatSupport/WEBP_Support.hpp in Exempi 2.4.5 has a
0f726d
NULL pointer dereference.
0f726d
0f726d
https://bugs.freedesktop.org/show_bug.cgi?id=106981
0f726d
https://gitlab.freedesktop.org/libopenraw/exempi/issues/9
0f726d
0f726d
Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
0f726d
Signed-off-by: Hubert Figuière <hub@figuiere.net>
0f726d
---
0f726d
 XMPFiles/source/FormatSupport/WEBP_Support.cpp | 8 +++++---
0f726d
 1 file changed, 5 insertions(+), 3 deletions(-)
0f726d
0f726d
diff --git a/XMPFiles/source/FormatSupport/WEBP_Support.cpp b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
0f726d
index ffaf220..4fe705b 100644
0f726d
--- a/XMPFiles/source/FormatSupport/WEBP_Support.cpp
0f726d
+++ b/XMPFiles/source/FormatSupport/WEBP_Support.cpp
0f726d
@@ -160,9 +160,11 @@ bool VP8XChunk::xmp()
0f726d
 }
0f726d
 void VP8XChunk::xmp(bool hasXMP)
0f726d
 {
0f726d
-    XMP_Uns32 flags = GetLE32(&this->data[0]);
0f726d
-    flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
0f726d
-    PutLE32(&this->data[0], flags);
0f726d
+    if (&this->data[0] != NULL) {
0f726d
+        XMP_Uns32 flags = GetLE32(&this->data[0]);
0f726d
+        flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
0f726d
+        PutLE32(&this->data[0], flags);
0f726d
+    }
0f726d
 }
0f726d
 
0f726d
 Container::Container(WEBP_MetaHandler* handler) : Chunk(NULL, handler)
0f726d
-- 
0f726d
2.17.1
0f726d