summaryrefslogtreecommitdiff
path: root/sax/source/fastparser/fastparser.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-30 14:01:16 -0400
committerMichael Stahl <mstahl@redhat.com>2014-07-01 10:00:16 +0000
commit8f59c9b4858cde1352eb60b2a3fe22853813b287 (patch)
tree8883f0297830b952c5aa2de341f2a937d731fb4d /sax/source/fastparser/fastparser.cxx
parenteb4a6f38829bfb9e2569c2a9b6e0e0ad6277555c (diff)
Check for empty() before calling top().
Else it might crash sometimes. Change-Id: I6a24fff83c3d36346debae5c0f2b8c0646a15c01 (cherry picked from commit 3f177756dbdb67d901453000c3f11694770d2761) Reviewed-on: https://gerrit.libreoffice.org/9991 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sax/source/fastparser/fastparser.cxx')
-rw-r--r--sax/source/fastparser/fastparser.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 0cfdb1483546..577f414696d5 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -682,6 +682,9 @@ sal_Int32 FastSaxParserImpl::GetTokenWithPrefix( const sal_Char*pPrefix, int nPr
sal_Int32 nNamespaceToken = FastToken::DONTKNOW;
Entity& rEntity = getEntity();
+ if (rEntity.maNamespaceCount.empty())
+ return nNamespaceToken;
+
sal_uInt32 nNamespace = rEntity.maNamespaceCount.top();
while( nNamespace-- )
{