summaryrefslogtreecommitdiff
path: root/starmath/source/mathmlimport.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-28 15:45:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-28 22:02:40 +0200
commit5fa446204e1e686412d84562750d9802bf1b9468 (patch)
tree45f69d6c10bd08a21fa6ded3bb59dd5a201d19fe /starmath/source/mathmlimport.cxx
parentaf1c5b959462bc7dcd675c6298ca69c69f33bd52 (diff)
ofz#7861 fuzzer ooms
too many frequent tiny allocations in a short time span I believe Change-Id: Iaccae6db7d18c9cd2f909f94dbe81a7dc6458bc2 Reviewed-on: https://gerrit.libreoffice.org/53589 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath/source/mathmlimport.cxx')
-rw-r--r--starmath/source/mathmlimport.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 6142db4a3ec4..8c0fc3f3d97c 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -515,9 +515,11 @@ void SmXMLImport::endDocument()
pDocShell->SetFormulaTree(static_cast<SmTableNode *>(pTree));
if (aText.isEmpty()) //If we picked up no annotation text
{
+ OUStringBuffer aStrBuf;
// Get text from imported formula
- pTree->CreateTextFromNode(aText);
- aText = comphelper::string::stripEnd(aText, ' ');
+ pTree->CreateTextFromNode(aStrBuf);
+ aStrBuf.stripEnd(' ');
+ aText = aStrBuf.makeStringAndClear();
}
// Convert symbol names