File r1881-Revert-part-of-r1872-_Fix-for-CVE-2017-8054_.patch of Package podofo.35912

------------------------------------------------------------------------
r1881 | mc-zyx | 2018-02-04 16:08:31 +0100 (dom, 04 feb 2018) | 4 lines

Revert part of r1872 (Fix for CVE-2017-8054 - Detect cycles in PdfPagesTree)

This part had been causing use-after-free in test/unit/podofo-test.


Index: src/doc/PdfPagesTree.cpp
===================================================================
--- src/doc/PdfPagesTree.cpp	(revision 1880)
+++ src/doc/PdfPagesTree.cpp	(revision 1881)
@@ -479,17 +479,7 @@
         if( rVar.IsArray() ) 
         {
             // Fixes some broken PDFs who have trees with 1 element kids arrays
-            // Recursive call removed to prevent stack overflow, replaced by:
-            // all the following inside this conditional, plus restart looping
-            const PdfArray & rVarArray = rVar.GetArray();
-            if (rVarArray.GetSize() == 0)
-            {
-                PdfError::LogMessage( eLogSeverity_Critical, "Trying to access"
-                    " first page index of empty array" );
-                return NULL;
-            }
-            rVar = rVarArray[0];
-            continue;
+            return GetPageNodeFromArray( 0, rVar.GetArray(), rLstParents );
         }
         else if( !rVar.IsReference() )
         {

------------------------------------------------------------------------
openSUSE Build Service is sponsored by