[Libreoffice-commits] core.git: 2 commits - oox/source sax/source
Caolán McNamara
caolanm at redhat.com
Tue Dec 2 06:53:33 PST 2014
oox/source/vml/vmlformatting.cxx | 10 +++++++---
sax/source/fastparser/fastparser.cxx | 10 ++++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
New commits:
commit 8302d048653d9ac25d3cb9ab9277df715053ad6a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 2 14:51:09 2014 +0000
Resolves: fdo#70157 fix crash on loading
Change-Id: I0d248a195852c14cd95d4e337823076dd2fbc19d
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 4056970..c6859b5 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -373,9 +373,13 @@ void ConversionHelper::decodeVmlPath( ::std::vector< ::std::vector< Point > >& r
break;
case CLOSE: // 0 param
- rPointLists.back().push_back( rPointLists.back()[ 0 ] );
- rFlagLists.back().push_back( rFlagLists.back()[ 0 ] );
- aCurrentPoint = rPointLists.back().back();
+ SAL_WARN_IF(rPointLists.back().empty() || rPointLists.back().empty(), "oox", "empty pointlists at close");
+ if (!rPointLists.back().empty() && !rFlagLists.back().empty())
+ {
+ rPointLists.back().push_back( rPointLists.back()[ 0 ] );
+ rFlagLists.back().push_back( rFlagLists.back()[ 0 ] );
+ aCurrentPoint = rPointLists.back().back();
+ }
break;
case END: // 0 param
commit 4a757923fed5210d7bcf580865d53d4097dfbc8e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 2 11:36:53 2014 +0000
fix crash-190212-093017-986
Change-Id: I3d2d57850dcb1fde1c004b4455591071a1fe03fa
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index ae0e8d8..92791fc 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -463,6 +463,12 @@ void Entity::startElement( Event *pEvent )
void Entity::characters( const OUString& sChars )
{
+ if (maContextStack.empty())
+ {
+ // Malformed XML stream !?
+ return;
+ }
+
const Reference< XFastContextHandler >& xContext( maContextStack.top().mxContext );
if( xContext.is() ) try
{
@@ -1140,11 +1146,11 @@ void FastSaxParserImpl::callbackEndElement( const xmlChar*, const xmlChar*, cons
if( !pendingCharacters.isEmpty())
sendPendingCharacters();
Entity& rEntity = getEntity();
- assert( !rEntity.maNamespaceCount.empty() );
+ SAL_WARN_IF(rEntity.maNamespaceCount.empty(), "sax", "Empty NamespaceCount");
if( !rEntity.maNamespaceCount.empty() )
rEntity.maNamespaceCount.pop();
- assert( !rEntity.maNamespaceStack.empty() );
+ SAL_WARN_IF(rEntity.maNamespaceStack.empty(), "sax", "Empty NamespaceStack");
if( !rEntity.maNamespaceStack.empty() )
rEntity.maNamespaceStack.pop();
More information about the Libreoffice-commits
mailing list