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-19532.patch

19 lines
1.0 KiB

diff -rupN podofo-0.9.6/tools/podofoimpose/pdftranslator.cpp podofo-0.9.6-new/tools/podofoimpose/pdftranslator.cpp
--- podofo-0.9.6/tools/podofoimpose/pdftranslator.cpp 2016-11-18 20:08:56.000000000 +0100
+++ podofo-0.9.6-new/tools/podofoimpose/pdftranslator.cpp 2018-12-19 22:42:37.061093680 +0100
@@ -256,7 +256,13 @@ namespace PoDoFo
PdfPage * page = sourceDoc->GetPage ( i );
PdfMemoryOutputStream outMemStream ( 1 );
- PdfXObject *xobj = new PdfXObject ( page->GetMediaBox(), targetDoc );
+ if (!page) // Fix issue #32
+ {
+ std::ostringstream oss;
+ oss << "Page " << i << " (0-based) of " << pcount << " in source doc not found!";
+ PODOFO_RAISE_ERROR_INFO( ePdfError_PageNotFound, oss.str() );
+ }
+ PdfXObject *xobj = new PdfXObject ( page->GetMediaBox(), targetDoc );
if ( page->GetContents()->HasStream() )
{
page->GetContents()->GetStream()->GetFilteredCopy ( &outMemStream );