File r1938-Fix-CVE-2018-11256-PdfError-info-gives-not-found-page-0-based.patch of Package podofo.23798
------------------------------------------------------------------------
r1938 | mabri | 2018-08-28 22:36:23 +0200 (mar 28 de ago de 2018) | 1 línea
Fix CVE-2018-11256: PdfError info gives not-found page 0-based (and says that)
Index: src/doc/PdfDocument.cpp
===================================================================
--- src/doc/PdfDocument.cpp (revisión: 1937)
+++ src/doc/PdfDocument.cpp (revisión: 1938)
@@ -325,6 +325,12 @@
for(int i=0;i<rDoc.GetPageCount();i++ )
{
PdfPage* pPage = rDoc.GetPage( i );
+ if (NULL == pPage)
+ {
+ std::ostringstream oss;
+ oss << "No page " << i << " (the first is 0) found.";
+ PODOFO_RAISE_ERROR_INFO( ePdfError_PageNotFound, oss.str() );
+ }
PdfObject* pObj = m_vecObjects.GetObject( PdfReference( pPage->GetObject()->Reference().ObjectNumber() + difference, pPage->GetObject()->Reference().GenerationNumber() ) );
if( pObj->IsDictionary() && pObj->GetDictionary().HasKey( "Parent" ) )
pObj->GetDictionary().RemoveKey( "Parent" );
------------------------------------------------------------------------