diff options
author | Eike Rathke <erack@redhat.com> | 2011-12-07 16:11:57 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-12-07 17:27:31 +0100 |
commit | cabf25372cf98869616c3d583eb99fa5f5eb3a8f (patch) | |
tree | 477ad848a6c40141f00c84e6bbfc0375c4517cfd /sc/source/filter/xml/xmlfilti.hxx | |
parent | d432b00bfa05b1bd1413fb0b9afac19de5c1f60b (diff) |
old class Stack pop'ed 0 from empty stack, which std::stack doesn't
Some places in the code assumed that if the stack is empty a null pointer is
returned by top() (or old Pop()), this doesn't work anymore with ::std::stack
that instead has undefined behavior in that case, so check !stack.empty()
first before accessing top.
(cherry picked from commit ac40f7d6503533954127e818f2bf009200c1e3f2)
Diffstat (limited to 'sc/source/filter/xml/xmlfilti.hxx')
-rw-r--r-- | sc/source/filter/xml/xmlfilti.hxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/filter/xml/xmlfilti.hxx b/sc/source/filter/xml/xmlfilti.hxx index bb301013bdda..759f95468a00 100644 --- a/sc/source/filter/xml/xmlfilti.hxx +++ b/sc/source/filter/xml/xmlfilti.hxx @@ -262,8 +262,14 @@ public: void CloseConnection() { - bool bTemp = aConnectionOrStack.top(); - aConnectionOrStack.pop(); + bool bTemp; + if (aConnectionOrStack.empty()) + bTemp = false; + else + { + bTemp = aConnectionOrStack.top(); + aConnectionOrStack.pop(); + } bConnectionOr = bTemp; bNextConnectionOr = bTemp; } |