Kaydet (Commit) 40c85b88 authored tarafından Fridrich Štrba's avatar Fridrich Štrba

fdo#53592: Try not to crash on empty m_ZipContent

Change-Id: I9bdc9997e260a75682177c8641695b60df0c81a6
üst d3300205
......@@ -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
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment