office-gobmx/libvisio/0001-fdo-70480-do-not-crash-reading-malformed-zip.patch
David Tardon f2422ab90d fdo#70480 do not crash reading malformed zip
Change-Id: Ibbdf7ce4979f8452c4a662cc9ae3f598cce23126
2013-10-18 10:52:25 +02:00

26 lines
818 B
Diff

From 410f564d9a728b983cf11ba9b3eadfc7d59c187c Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 17 Oct 2013 10:35:34 +0200
Subject: [PATCH] fdo#70480 do not crash reading malformed zip
Change-Id: Ia37e8be5172a49669cb9f7271c5401ca88f39072
---
src/lib/VSDZipStream.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lib/VSDZipStream.cpp b/src/lib/VSDZipStream.cpp
index 3b3e08a..1c12d56 100644
--- a/src/lib/VSDZipStream.cpp
+++ b/src/lib/VSDZipStream.cpp
@@ -203,6 +203,8 @@ bool libvisio::VSDZipStreamImpl::isZipStream()
return false;
if (!readCentralDirectory(end))
return false;
+ if (m_cdir.empty())
+ return false;
CentralDirectoryEntry entry = m_cdir.begin()->second;
m_input->seek(entry.offset, WPX_SEEK_SET);
LocalFileHeader header;
--
1.8.3.1