[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Sep 26 12:41:47 UTC 2021


 sw/source/filter/ww8/ww8graf.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 278ea37351daa4a74705fd615ca6bacb04db5c90
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Sep 25 20:45:34 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Sep 26 14:41:14 2021 +0200

    ofz#39150 avoid Timeout with large editengine strings
    
    Change-Id: I06413377120420acf132fcbe1a6a9866bdb7ccd2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122612
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 3013b73aa088..83a5a772973a 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -967,6 +967,12 @@ std::optional<OutlinerParaObject> SwWW8ImplReader::ImportAsOutliner(OUString &rS
     sal_Int32 nLen = GetRangeAsDrawingString(rString, nStartCp, nEndCp, eType);
     if (nLen > 0)
     {
+        if (m_bFuzzing && rString.getLength() > 1024)
+        {
+            SAL_WARN("sw.ww8", "Truncating long EditEngine strings when fuzzing for performance");
+            rString = rString.copy(0, 1024);
+        }
+
         if (!m_pDrawEditEngine)
         {
             m_pDrawEditEngine.reset(new EditEngine(nullptr));


More information about the Libreoffice-commits mailing list