diff options
author | Wei Li <weili@chromium.org> | 2016-01-19 12:16:49 -0800 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2016-01-19 12:16:49 -0800 |
commit | 90853cb1dfd1bf3803ec21cfae3e93948137be61 (patch) | |
tree | 0bac14905d5f767039707453b307dc94ad1b44d6 /fpdfsdk | |
parent | 2cb9ae0309417222aa3555dabe4749119dc36d84 (diff) | |
download | pdfium-90853cb1dfd1bf3803ec21cfae3e93948137be61.tar.xz |
Fix infinite loops caused by calling circular indirect objects
There are multiple functions in CPDF_Object class which can cause infinite loop due to recursively calling circular indirect objects. Fix them by deference indirect object first.
BUG=pdfium:355
R=jun_fang@foxitsoftware.com, thestig@chromium.org
Review URL: https://codereview.chromium.org/1585533002 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/src/fpdfview_embeddertest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp index 09d1f07e82..da7313dd5f 100644 --- a/fpdfsdk/src/fpdfview_embeddertest.cpp +++ b/fpdfsdk/src/fpdfview_embeddertest.cpp @@ -235,6 +235,11 @@ TEST_F(FPDFViewEmbeddertest, Hang_344) { EXPECT_FALSE(OpenDocument("bug_344.pdf")); } +// The test should pass when there is no infinite recursion in +// CPDF_SyntaxParser::GetString(). +TEST_F(FPDFViewEmbeddertest, Hang_355) { + EXPECT_FALSE(OpenDocument("bug_355.pdf")); +} // The test should pass even when the file has circular references to pages. TEST_F(FPDFViewEmbeddertest, Hang_360) { EXPECT_FALSE(OpenDocument("bug_360.pdf")); |