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

Unified Diff: core/fpdfdoc/cpdf_interform.cpp

Issue 2250533002: Fix stack overflow in object Clone() functions (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase again Created 4 years, 4 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 | « core/fpdfapi/fpdf_parser/include/cpdf_string.h ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_interform.cpp
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index cf728a7d4bda77a3957a3593b8205d0ee17b8be3..a6f73c620bbd81c9237e04ceaab9fa7660f7da06 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -1403,7 +1403,7 @@ CPDF_FormField* CPDF_InterForm::AddTerminalField(CPDF_Dictionary* pFieldDict) {
pField = new CPDF_FormField(this, pParent);
CPDF_Object* pTObj = pDict->GetObjectBy("T");
if (ToReference(pTObj)) {
- CPDF_Object* pClone = pTObj->Clone(TRUE);
+ CPDF_Object* pClone = pTObj->CloneDirectObject();
if (pClone)
pDict->SetAt("T", pClone);
else
@@ -1535,7 +1535,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(
} else {
CPDF_Object* pV = FPDF_GetFieldAttr(pField->m_pDict, "V");
if (pV)
- pFieldDict->SetAt("V", pV->Clone(TRUE));
+ pFieldDict->SetAt("V", pV->CloneDirectObject());
}
pFields->Add(pFieldDict);
}
@@ -1587,8 +1587,8 @@ void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict,
CPDF_FormField::Type eType = pField->GetType();
if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) &&
pFieldDict->KeyExist("Opt")) {
- pField->m_pDict->SetAt("Opt",
- pFieldDict->GetDirectObjectBy("Opt")->Clone(TRUE));
+ pField->m_pDict->SetAt(
+ "Opt", pFieldDict->GetDirectObjectBy("Opt")->CloneDirectObject());
}
if (bNotify && m_pFormNotify) {
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_string.h ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698