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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_array_unittest.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_array_unittest.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_array_unittest.cpp b/core/fpdfapi/fpdf_parser/cpdf_array_unittest.cpp
index 58a47a4ab7b2c217206d8e9e3d4922cc4a524a51..1a24a3f26ca0f45e4dbe72c99aec99c8cf590c09 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_array_unittest.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_array_unittest.cpp
@@ -125,10 +125,10 @@ TEST(cpdf_array, Clone) {
ASSERT_EQ(kNumOfRows, arr->GetCount());
// Not dereferencing reference objects means just creating new references
// instead of new copies of direct objects.
- ScopedArray arr1(arr->Clone(FALSE)->AsArray());
+ ScopedArray arr1(arr->Clone()->AsArray());
EXPECT_EQ(arr->GetCount(), arr1->GetCount());
// Dereferencing reference objects creates new copies of direct objects.
- ScopedArray arr2(arr->Clone(TRUE)->AsArray());
+ ScopedArray arr2(arr->CloneDeRef(true)->AsArray());
EXPECT_EQ(arr->GetCount(), arr2->GetCount());
for (size_t i = 0; i < kNumOfRows; ++i) {
CPDF_Array* arr_elem = arr->GetObjectAt(i)->AsArray();

Powered by Google App Engine
This is Rietveld 408576698