summaryrefslogtreecommitdiff
path: root/sax/source/fastparser/fastparser.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sax/source/fastparser/fastparser.cxx')
-rw-r--r--sax/source/fastparser/fastparser.cxx10
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();