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

Issue 1755273002: Fix parsing of object numbers > 16,777,216. (Closed)

Created:
4 years, 9 months ago by dsinclair
Modified:
4 years, 9 months ago
Reviewers:
Lei Zhang, Tom Sepez
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix parsing of object numbers > 16,777,216. Currently, there is a check that an object number is <= 0x1000000. If that check fails, we end up putting the parser into a bad state and fail to load documents. The object does not need to be in the XRef table, or referenced from the document, just be in the document. This Cl removes the size check and updates the various atoi calls to use a uint32_t instead of an int32_t so we don't end up getting strange values when converting from a string. BUG=455199 R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/42fb301abcf6b9f6a580f3d30defeadedf5d7ebd

Patch Set 1 #

Total comments: 6

Patch Set 2 : Rebase to master #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 8

Patch Set 5 : #

Patch Set 6 : Rebase to master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -47 lines) Patch
M BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M core/include/fpdfapi/fpdf_parser.h View 2 chunks +4 lines, -11 lines 0 comments Download
M core/include/fxcrt/fx_system.h View 1 chunk +1 line, -0 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 15 chunks +16 lines, -20 lines 0 comments Download
M core/src/fxcrt/fx_basic_gcc.cpp View 1 2 3 chunks +15 lines, -10 lines 0 comments Download
A core/src/fxcrt/fx_basic_gcc_unittest.cpp View 1 2 3 4 1 chunk +88 lines, -0 lines 0 comments Download
M pdfium.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A + testing/resources/bug_455199.pdf View 1 2 3 4 5 3 chunks +12 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
dsinclair
PTAL. With this CL we can parse and render the fuzz-95 document in the attached ...
4 years, 9 months ago (2016-03-02 19:32:23 UTC) #2
Tom Sepez
https://codereview.chromium.org/1755273002/diff/1/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/1755273002/diff/1/core/src/fxcrt/fx_basic_gcc.cpp#newcode41 core/src/fxcrt/fx_basic_gcc.cpp:41: Are you sure you want to enable this for ...
4 years, 9 months ago (2016-03-02 20:23:53 UTC) #3
Tom Sepez
https://codereview.chromium.org/1755273002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp (right): https://codereview.chromium.org/1755273002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp#newcode111 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp:111: EXPECT_TRUE(OpenDocument("bug_455199.pdf")); Does this take the 17 seconds alluded to ...
4 years, 9 months ago (2016-03-02 20:56:38 UTC) #4
dsinclair
https://codereview.chromium.org/1755273002/diff/1/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/1755273002/diff/1/core/src/fxcrt/fx_basic_gcc.cpp#newcode41 core/src/fxcrt/fx_basic_gcc.cpp:41: On 2016/03/02 20:23:52, Tom Sepez wrote: > Are you ...
4 years, 9 months ago (2016-03-02 21:02:06 UTC) #5
dsinclair
https://codereview.chromium.org/1755273002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp File core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp (right): https://codereview.chromium.org/1755273002/diff/1/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp#newcode111 core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp:111: EXPECT_TRUE(OpenDocument("bug_455199.pdf")); On 2016/03/02 20:56:38, Tom Sepez wrote: > Does ...
4 years, 9 months ago (2016-03-02 21:27:29 UTC) #6
Tom Sepez
Good, but let's take one more crack at it. https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc_unittest.cpp File core/src/fxcrt/fx_basic_gcc_unittest.cpp (right): https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc_unittest.cpp#newcode14 core/src/fxcrt/fx_basic_gcc_unittest.cpp:14: ...
4 years, 9 months ago (2016-03-02 21:46:23 UTC) #7
Tom Sepez
https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc_unittest.cpp File core/src/fxcrt/fx_basic_gcc_unittest.cpp (right): https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc_unittest.cpp#newcode15 core/src/fxcrt/fx_basic_gcc_unittest.cpp:15: Oh, and anything that takes a string needs to ...
4 years, 9 months ago (2016-03-02 21:47:38 UTC) #8
Tom Sepez
https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc_unittest.cpp File core/src/fxcrt/fx_basic_gcc_unittest.cpp (right): https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc_unittest.cpp#newcode1 core/src/fxcrt/fx_basic_gcc_unittest.cpp:1: // Copyright 2014 PDFium Authors. All rights reserved. nit: ...
4 years, 9 months ago (2016-03-02 21:48:37 UTC) #9
Tom Sepez
https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc.cpp#newcode48 core/src/fxcrt/fx_basic_gcc.cpp:48: T val = FXSYS_toDecimalDigitWide(*str); If you really want some ...
4 years, 9 months ago (2016-03-02 21:53:37 UTC) #10
dsinclair
https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/1755273002/diff/60001/core/src/fxcrt/fx_basic_gcc.cpp#newcode48 core/src/fxcrt/fx_basic_gcc.cpp:48: T val = FXSYS_toDecimalDigitWide(*str); On 2016/03/02 21:53:36, Tom Sepez ...
4 years, 9 months ago (2016-03-02 22:09:18 UTC) #11
Tom Sepez
lgtm
4 years, 9 months ago (2016-03-02 22:56:56 UTC) #12
dsinclair
4 years, 9 months ago (2016-03-03 13:59:28 UTC) #14
Message was sent while issue was closed.
Committed patchset #6 (id:100001) manually as
42fb301abcf6b9f6a580f3d30defeadedf5d7ebd (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698