summaryrefslogtreecommitdiff
path: root/sax
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:56 +0000
commit67e3dac2663e1336be1e89b18a9af06ee7ab4fcb (patch)
tree8ebf60ccbdf7ab3a71f0511d40400c03752356c4 /sax
parenta502b3401fbfb0c71bda96e0165c3d3296705b76 (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/9990 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sax')
-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 336f5eed71b7..603adf57429b 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -654,6 +654,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-- )
{