diff options
author | tsepez <tsepez@chromium.org> | 2016-09-20 13:23:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-20 13:23:21 -0700 |
commit | 5a399de2945d7b244802565d8e9d2f6e662561da (patch) | |
tree | 9c25da0dd44043f69b750a9071533596aa92c6e3 /core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp | |
parent | 0d726c0c9931979d9b0594d56b52c861e08e09ba (diff) | |
download | pdfium-5a399de2945d7b244802565d8e9d2f6e662561da.tar.xz |
Make CPDF_Array not do indirect object creation.
We remove the indirect object holder argument and check that
call sites pass ownable objects, adding a reference in one
place that always was passing an indirect object.
Also check that the invariant isn't violated, we need to fail
here in the wild and investigate -- these are existing UAFs.
Review-Url: https://codereview.chromium.org/2355083002
Diffstat (limited to 'core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp b/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp index 5772043367..cbfdf2b9ac 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp @@ -813,7 +813,8 @@ TEST(PDFObjectTest, CloneCheckLoop) { objects_holder.AddIndirectObject(dict_obj); EXPECT_EQ(1u, dict_obj->GetObjNum()); dict_obj->SetFor("arr", arr_obj); - arr_obj->InsertAt(0, dict_obj, &objects_holder); + arr_obj->InsertAt( + 0, new CPDF_Reference(&objects_holder, dict_obj->GetObjNum())); CPDF_Object* elem0 = arr_obj->GetObjectAt(0); ASSERT_TRUE(elem0); ASSERT_TRUE(elem0->IsReference()); |