summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-08-27 16:33:13 +0200
committerAndras Timar <atimar@suse.com>2012-08-27 16:50:12 +0200
commitc828a2fe53b7dede97d9b3b69462db22fb496685 (patch)
treed48c0aa7bef3c96d3aefb4c097848d14dc0a490a /shell
parentfdo#53533: don't seek to bogus offset (diff)
downloadcore-c828a2fe53b7dede97d9b3b69462db22fb496685.tar.gz
core-c828a2fe53b7dede97d9b3b69462db22fb496685.zip
fdo#53592: Try not to crash on empty m_ZipContent
Change-Id: I9bdc9997e260a75682177c8641695b60df0c81a6 Signed-off-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/ooofilereader/basereader.cxx9
-rw-r--r--shell/source/win32/zipfile/zipfile.cxx4
2 files changed, 9 insertions, 4 deletions
diff --git a/shell/source/win32/ooofilereader/basereader.cxx b/shell/source/win32/ooofilereader/basereader.cxx
index f4f694e6c683..754d37e87e0b 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 13b319cc749c..381e52cf7642 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);
}
}