diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-01 19:25:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-02 10:13:23 +0200 |
commit | e7a4426872429c2f286819cc0bdbc65fe4bd79cd (patch) | |
tree | f10e58038ce5166162c4332f9ca5e74a3358b4da | |
parent | d5415561e3979d33b2a7e1a06e2d5515a1e1dd33 (diff) |
forcepoint#66 make sure we don't get stuck endlessly reparsing
Change-Id: Ie2733e8d7f73e5f6a072604c477e949cd944189a
Reviewed-on: https://gerrit.libreoffice.org/58441
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/filter/ipdf/pdfdocument.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
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(); + } } } |