diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-02 11:36:53 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-02 17:11:05 +0000 |
commit | 060317b22fe5d09d1a45541ca5b5c5db46a83f29 (patch) | |
tree | 9a4b80ced65eadaf857415a306928341ffd50035 /sax | |
parent | f070a64a1d3ccdb382a189506bd4c5001411fc11 (diff) |
fix crash-190212-093017-986
Change-Id: I3d2d57850dcb1fde1c004b4455591071a1fe03fa
(cherry picked from commit 4a757923fed5210d7bcf580865d53d4097dfbc8e)
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 0de4f4239f1d..83bd7daa83a2 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 { @@ -1138,11 +1144,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(); |