You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
podofo/podofo_CVE-2018-11256.patch

17 lines
1012 B

diff -rupN podofo-0.9.6/src/doc/PdfDocument.cpp podofo-0.9.6-new/src/doc/PdfDocument.cpp
--- podofo-0.9.6/src/doc/PdfDocument.cpp 2016-11-18 20:08:56.000000000 +0100
+++ podofo-0.9.6-new/src/doc/PdfDocument.cpp 2018-12-19 22:42:36.969100985 +0100
@@ -325,6 +325,12 @@ const PdfDocument & PdfDocument::Append(
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" );