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

Unified Diff: core/include/fpdfapi/fpdf_parser.h

Issue 875263002: Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: explicit constructor. Created 5 years, 11 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 | core/include/fxcrt/fx_basic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfapi/fpdf_parser.h
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 3f9bda5ad8e581758e01977123c239f7737eaa90..e1a0f5cf1af7cd90dc19b753a21bb5fb6b5db630 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -261,10 +261,10 @@ public:
m_Pos = pos;
}
- CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE);
+ CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE);
- CPDF_Object* GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL);
+ CPDF_Object* GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL);
int GetDirectNum();
@@ -302,6 +302,8 @@ public:
CFX_ByteString GetNextWord(FX_BOOL& bIsNumber);
protected:
+ static const int kParserMaxRecursionDepth = 64;
+ static int s_CurrentRecursionDepth;
virtual FX_BOOL GetNextChar(FX_BYTE& ch);
@@ -520,7 +522,6 @@ public:
return m_dwFirstPageNo;
}
protected:
-
CPDF_Document* m_pDocument;
CPDF_SyntaxParser m_Syntax;
« no previous file with comments | « no previous file | core/include/fxcrt/fx_basic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698