summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2021-08-20 04:08:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-20 09:36:05 +0200
commitaa232a45bc0d5daf4a0ae4b47b9459000d1ec210 (patch)
tree085f082ceaa5b784daae137247b8dbf629d294b3 /starmath
parente5a7a65e59fcd300834e5a7d20b797dedbeb6b69 (diff)
Add security handlers to the iterators
Change-Id: I0cc8dd92c7ae870e58f0f9118df76569d6deecd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120764 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathml/iterator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/starmath/source/mathml/iterator.cxx b/starmath/source/mathml/iterator.cxx
index 5e88a717f6c1..481ff799689c 100644
--- a/starmath/source/mathml/iterator.cxx
+++ b/starmath/source/mathml/iterator.cxx
@@ -54,11 +54,15 @@ static inline void cloneElement(SmMlElement* aSmMlElement, void* aData)
void SmMlIteratorFree(SmMlElement* pMlElementTree)
{
+ if (pMlElementTree == nullptr)
+ return;
SmMlIteratorBottomToTop(pMlElementTree, deleteElement, nullptr);
}
SmMlElement* SmMlIteratorCopy(SmMlElement* pMlElementTree)
{
+ if (pMlElementTree == nullptr)
+ return nullptr;
SmMlElement* aDummyElement = new SmMlElement();
SmMlIteratorTopToBottom(pMlElementTree, cloneElement, &aDummyElement);
SmMlElement* aResultElement = aDummyElement->getSubElement(0);