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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_object.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/cpdf_number.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_object.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_object.cpp b/core/fpdfapi/fpdf_parser/cpdf_object.cpp
index ec967d10328ef57960c0caf3d2ef5a460b8eb18f..7da12a2b4f20d976d05b63734cd66b1f25276e70 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_object.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_object.cpp
@@ -22,6 +22,21 @@ CPDF_Object* CPDF_Object::GetDirect() const {
return const_cast<CPDF_Object*>(this);
}
+CPDF_Object* CPDF_Object::CloneObjectNonCyclic(bool bDirect) const {
+ std::set<const CPDF_Object*> visited_objs;
+ return CloneNonCyclic(bDirect, &visited_objs);
+}
+
+CPDF_Object* CPDF_Object::CloneDirectObject() const {
+ return CloneObjectNonCyclic(true);
+}
+
+CPDF_Object* CPDF_Object::CloneNonCyclic(
+ bool bDirect,
+ std::set<const CPDF_Object*>* pVisited) const {
+ return Clone();
+}
+
void CPDF_Object::Release() {
if (m_ObjNum)
return;
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_number.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698