Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Unified Diff: fpdfsdk/src/fpdfppo.cpp

Issue 553613003: Check the validity of pointers before they are utilized (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfppo.cpp
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index b8d2125b7dab667e0e0d9d50aa708474309757b6..a5c42756484063829d7314882b1e2c104743415d 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -313,9 +313,17 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt
}
else
{
- CPDF_Object* pClone = pRef->GetDirect()->Clone();
- if(!pClone)
+ CPDF_Object* pDirect = pRef->GetDirect();
+ if(!pDirect)
+ {
+ return 0;
+ }
+
+ CPDF_Object* pClone = pDirect->Clone();
+ if(!pClone)
+ {
return 0;
+ }
if(pClone->GetType() == PDFOBJ_DICTIONARY)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698