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

Issue 2636403003: Bad indexing in CPDF_Document::FindPageIndex when page tree corrupt. (Closed)

Created:
3 years, 11 months ago by Tom Sepez
Modified:
3 years, 11 months ago
Reviewers:
dsinclair
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Bad indexing in CPDF_Document::FindPageIndex when page tree corrupt. Moving to std::vector from the more forgiving CFX_ArrayTemplate revealed the dubious page tree traversal, which depends on the correctness of the /Count entries to properly summarize the total descendants under a given node. The only "correct" thing to do is to throw away these counts as parsed, and re-compute them, perhaps in CountPages(). But I'm not willing to do that since it may break unknown documents in the wild. Pass out-params as pointers while we're at it. BUG=680376 Review-Url: https://codereview.chromium.org/2636403003 Committed: https://pdfium.googlesource.com/pdfium/+/e507dc5004184ae3f8fd1cd19b723b4be69a46da

Patch Set 1 #

Patch Set 2 : lost conditional #

Patch Set 3 : return -1 for out-of-range #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -19 lines) Patch
M core/fpdfapi/parser/cpdf_document.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_document.cpp View 1 2 3 chunks +21 lines, -17 lines 1 comment Download
M fpdfsdk/fpdfdoc_embeddertest.cpp View 1 chunk +10 lines, -0 lines 0 comments Download
A testing/resources/bug_680376.in View 1 chunk +130 lines, -0 lines 0 comments Download
A testing/resources/bug_680376.pdf View 1 2 1 chunk +156 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (9 generated)
Tom Sepez
Dan, for review.
3 years, 11 months ago (2017-01-18 18:04:42 UTC) #4
dsinclair
lgtm
3 years, 11 months ago (2017-01-18 18:08:15 UTC) #7
Tom Sepez
https://codereview.chromium.org/2636403003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp File core/fpdfapi/parser/cpdf_document.cpp (left): https://codereview.chromium.org/2636403003/diff/40001/core/fpdfapi/parser/cpdf_document.cpp#oldcode552 core/fpdfapi/parser/cpdf_document.cpp:552: m_PageList[index + i] = objnum; Note: move to 592 ...
3 years, 11 months ago (2017-01-18 18:08:42 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2636403003/40001
3 years, 11 months ago (2017-01-18 18:09:27 UTC) #11
commit-bot: I haz the power
3 years, 11 months ago (2017-01-18 18:24:40 UTC) #14
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://pdfium.googlesource.com/pdfium/+/e507dc5004184ae3f8fd1cd19b723b4be69a...

Powered by Google App Engine
This is Rietveld 408576698