summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-23 22:08:37 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-23 22:08:37 -0700
commita470b5e5371d0674d06068ec38d0d3c3279e85e1 (patch)
treee13f893084515082052e30c1cb8d94ec6303e38b /fpdfsdk
parent0dadcc6fdab7ad1f2ee95d763f31aad5d3534f93 (diff)
downloadpdfium-a470b5e5371d0674d06068ec38d0d3c3279e85e1.tar.xz
Fix stack overflow in object Clone() functions
For some complex objects such as CPDF_Dictionary, CPDF_Array, CPDF_Stream, and CPDF_Reference, Clone() could be executed with infinite recursion to cause the stack overflow. Fix this by checking already cloned objects to avoid recursion. BUG=pdfium:513 Review-Url: https://codereview.chromium.org/2250533002
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfppo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index 97fd390cb3..85dba5e975 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -407,6 +407,6 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc,
if (!pDstDict)
return FALSE;
- pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE));
+ pDstDict->SetAt("ViewerPreferences", pSrcDict->CloneDirectObject());
return TRUE;
}