summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-30 14:01:16 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-30 14:04:26 -0400
commit313b2c4973a367c3c2ac3e0677e5166f4d6a2e85 (patch)
treed09a7930006c52b2362ccabbe0a46d8a99f5cc94
parentb8255bc0ac513af5d9bc7ae026caf885f71569c6 (diff)
Check for empty() before calling top().
Else it might crash sometimes. Change-Id: I6a24fff83c3d36346debae5c0f2b8c0646a15c01 (cherry picked from commit 3f177756dbdb67d901453000c3f11694770d2761)
-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 aa755136bfe6..4ddbd2a54cee 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -688,6 +688,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-- )
{