[Libreoffice-commits] .: shell/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 27 07:34:03 PDT 2012


 shell/source/win32/ooofilereader/basereader.cxx |    9 ++++++---
 shell/source/win32/zipfile/zipfile.cxx          |    4 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 40c85b88ad0351acaf59fd2372676cdb8ca452d6
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Mon Aug 27 16:33:13 2012 +0200

    fdo#53592: Try not to crash on empty m_ZipContent
    
    Change-Id: I9bdc9997e260a75682177c8641695b60df0c81a6

diff --git a/shell/source/win32/ooofilereader/basereader.cxx b/shell/source/win32/ooofilereader/basereader.cxx
index f4f694e..754d37e 100644
--- a/shell/source/win32/ooofilereader/basereader.cxx
+++ b/shell/source/win32/ooofilereader/basereader.cxx
@@ -81,9 +81,12 @@ void CBaseReader::Initialize( const std::string& ContentName)
         if (m_ZipContent.empty())
             m_ZipFile.GetUncompressedContent( ContentName, m_ZipContent );
 
-        xml_parser parser;
-        parser.set_document_handler(this);  // pass current reader as reader to the sax parser
-        parser.parse(&m_ZipContent[0], m_ZipContent.size());
+        if (!m_ZipContent.empty())
+        {
+            xml_parser parser;
+            parser.set_document_handler(this);  // pass current reader as reader to the sax parser
+            parser.parse(&m_ZipContent[0], m_ZipContent.size());
+        }
     }
     catch(std::exception&
     #if OSL_DEBUG_LEVEL > 0
diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx
index 13b319c..381e52c 100644
--- a/shell/source/win32/zipfile/zipfile.cxx
+++ b/shell/source/win32/zipfile/zipfile.cxx
@@ -261,6 +261,8 @@ static bool areHeadersConsistent(const LocalFileHeader &header, const CentralDir
 
 static bool findCentralDirectoryEnd(StreamInterface *stream)
 {
+    if (!stream)
+        return false;
     stream->sseek(0, SEEK_SET);
     try
     {
@@ -483,7 +485,7 @@ void ZipFile::GetUncompressedContent(
             ContentBuffer.clear();
             return;
         }
-		(void)inflateEnd(&strm);
+        (void)inflateEnd(&strm);
     }
 }
 


More information about the Libreoffice-commits mailing list