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

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: change due to rebase 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
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..6410e06620a56038eab26650ee6e812b7868d94d 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_object.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_object.cpp
@@ -22,10 +22,22 @@ CPDF_Object* CPDF_Object::GetDirect() const {
return const_cast<CPDF_Object*>(this);
}
+CPDF_Object* CPDF_Object::CloneDeRef(bool bDirect) const {
dsinclair 2016/08/18 14:04:31 Oh, I though this was clone dereference. I think t
Wei Li 2016/08/18 22:02:30 CloneWithCheck() was originally set to public to a
+ std::set<const CPDF_Object*> visited_objs;
+ return CloneWithCheck(bDirect, &visited_objs);
+}
+
+CPDF_Object* CPDF_Object::CloneWithCheck(
+ bool bDirect,
+ std::set<const CPDF_Object*>* pVisited) const {
+ return Clone();
+}
+
void CPDF_Object::Release() {
if (m_ObjNum)
return;
+ m_ObjNum = kInvalidObjNum;
dsinclair 2016/08/18 14:04:31 The Destroy() call is going to delete the object s
Wei Li 2016/08/18 22:02:30 Moved to each complex class's dtor to avoid double
Destroy();
}

Powered by Google App Engine
This is Rietveld 408576698