From 6bebd2e3cfb7790580722836d0debab3103c94d0 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 11 Apr 2018 00:13:36 +0000 Subject: Avoid stack overflow when loading CPDF_Function. CPDF_StitchFuncs that reference each other create a Load() loop. Maintaining a set of the visited CPDF_Objects during a Load() call tree prevents that. Bug: chromium:830221 Change-Id: I6f494da16c6d79f05870ff85cff38ff8fe69ecfe Reviewed-on: https://pdfium-review.googlesource.com/30050 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/page/cpdf_expintfunc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi/page/cpdf_expintfunc.cpp') diff --git a/core/fpdfapi/page/cpdf_expintfunc.cpp b/core/fpdfapi/page/cpdf_expintfunc.cpp index 5d1213131b..f26df1b01e 100644 --- a/core/fpdfapi/page/cpdf_expintfunc.cpp +++ b/core/fpdfapi/page/cpdf_expintfunc.cpp @@ -20,7 +20,8 @@ CPDF_ExpIntFunc::~CPDF_ExpIntFunc() { FX_Free(m_pEndValues); } -bool CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) { +bool CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj, + std::set* pVisited) { CPDF_Dictionary* pDict = pObj->GetDict(); if (!pDict) return false; -- cgit v1.2.3