[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 3 09:12:00 UTC 2018


 vcl/source/filter/ipdf/pdfdocument.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 79e5f8a1f875c169759dc45d93d2b521ec9368f6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 1 19:25:27 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Aug 3 11:11:37 2018 +0200

    forcepoint#66 make sure we don't get stuck endlessly reparsing
    
    Change-Id: Ie2733e8d7f73e5f6a072604c477e949cd944189a
    Reviewed-on: https://gerrit.libreoffice.org/58450
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index 3d9008a22943..c74bcbbade84 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -2212,9 +2212,14 @@ size_t PDFDictionaryElement::Parse(const std::vector<std::unique_ptr<PDFElement>
             else if (!pDictionary->alreadyParsing())
             {
                 // Nested dictionary.
-                i = PDFDictionaryElement::Parse(rElements, pDictionary, pDictionary->m_aItems);
-                rDictionary[aName] = pDictionary;
-                aName.clear();
+                const size_t nexti
+                    = PDFDictionaryElement::Parse(rElements, pDictionary, pDictionary->m_aItems);
+                if (nexti >= i) // ensure we go forwards and not endlessly loop
+                {
+                    i = nexti;
+                    rDictionary[aName] = pDictionary;
+                    aName.clear();
+                }
             }
         }
 


More information about the Libreoffice-commits mailing list