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

Issue 1476163002: Add basic checking for RebuildCrossRef (Closed)

Created:
5 years ago by Wei Li
Modified:
5 years ago
Reviewers:
Lei Zhang, jun_fang
CC:
pdfium-reviews_googlegroups.com, kai_jing
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add basic checking for RebuildCrossRef RebuildCrossRef function returns false when we can not find file trailer or any indirect object. This serves as a basic file format checking. BUG=pdfium:215 R=jun_fang@foxitsoftware.com Committed: https://pdfium.googlesource.com/pdfium/+/f14da1d58e8e12633c7a47e6efd5ffe43bb37b4b

Patch Set 1 : #

Total comments: 4

Patch Set 2 : change to explict checking #

Patch Set 3 : remove unnecessary local variables #

Total comments: 2

Patch Set 4 : add root object checking #

Total comments: 8

Patch Set 5 : not checking root obj #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -12 lines) Patch
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 2 4 3 chunks +6 lines, -12 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp View 4 2 chunks +11 lines, -0 lines 0 comments Download
A testing/resources/parser_rebuildxref_error_notrailer.pdf View 1 2 3 4 1 chunk +51 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
Wei Li
PTAL, thanks
5 years ago (2015-11-25 23:15:44 UTC) #3
Lei Zhang
Looks good, but Jun should sign off on it as well. https://codereview.chromium.org/1476163002/diff/20001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): ...
5 years ago (2015-11-26 00:42:41 UTC) #5
Wei Li
thanks, I will wait for Jun's comments as well. https://codereview.chromium.org/1476163002/diff/20001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1476163002/diff/20001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode253 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:253: ...
5 years ago (2015-11-26 01:22:22 UTC) #6
jun_fang
LGTM with a nit. https://codereview.chromium.org/1476163002/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1476163002/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode252 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:252: if (!RebuildCrossRef() || GetRootObjNum() == ...
5 years ago (2015-11-26 04:30:51 UTC) #7
Wei Li
Hi, Jun: The previous change didn't check for root object. So it still returns true ...
5 years ago (2015-11-30 18:23:11 UTC) #8
jun_fang
On 2015/11/30 18:23:11, Wei wrote: > Hi, Jun: > > The previous change didn't check ...
5 years ago (2015-12-01 14:41:24 UTC) #9
jun_fang
https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (left): https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#oldcode1612 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:1612: if (RootObjNum == 0) { It's a trigger to ...
5 years ago (2015-12-01 14:56:20 UTC) #10
jun_fang
https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode975 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:975: return m_pTrailer && GetRootObjNum() > 0 && m_CrossRef.GetSize() > ...
5 years ago (2015-12-01 15:20:58 UTC) #11
jun_fang
https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (right): https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode252 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:252: if (!RebuildCrossRef()) please check the comment at line 1610.
5 years ago (2015-12-01 15:25:18 UTC) #12
Wei Li
https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (left): https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#oldcode1612 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:1612: if (RootObjNum == 0) { On 2015/12/01 14:56:20, jun_fang ...
5 years ago (2015-12-01 18:45:04 UTC) #13
jun_fang
On 2015/12/01 18:45:04, Wei wrote: > https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp > File core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp (left): > > https://codereview.chromium.org/1476163002/diff/80001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#oldcode1612 > ...
5 years ago (2015-12-02 00:30:29 UTC) #14
Wei Li
5 years ago (2015-12-02 01:19:22 UTC) #16
Message was sent while issue was closed.
Committed patchset #5 (id:100001) manually as
f14da1d58e8e12633c7a47e6efd5ffe43bb37b4b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698