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

Issue 524443002: Fix a bug when assign the generation number of indirect objects (Closed)

Created:
6 years, 3 months ago by Bo Xu
Modified:
5 years, 9 months ago
Reviewers:
Tom Sepez, jun_fang
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Visibility:
Public.

Description

Fix a bug when assign the generation number of indirect objects BUG=408532 R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/2d282243dbd1edd51d42e13f563903a1a76ce8f8

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Untabify #

Patch Set 4 : Simplify #

Total comments: 5

Patch Set 5 : Change real_objnum to parser_objnum, check StrToInt overflow #

Total comments: 3

Patch Set 6 : Use safe math #

Total comments: 3

Patch Set 7 : Use numeric_limits #

Patch Set 8 : #include <limits> #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -13 lines) Patch
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 2 3 4 5 chunks +15 lines, -13 lines 0 comments Download
M core/src/fxcrt/fx_basic_gcc.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Bo Xu
bo_xu@foxitsoftware.com changed reviewers: + jun_fang@foxitsoftware.com, tsepez@chromium.org
6 years, 3 months ago (2014-08-28 23:46:14 UTC) #1
Bo Xu
Hi Tom, please review.
6 years, 3 months ago (2014-08-28 23:46:14 UTC) #2
Bo Xu
https://codereview.chromium.org/524443002/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/524443002/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode1396 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:1396: if(pObj) { Here when objnum >1, real_objnum must equal ...
6 years, 3 months ago (2014-08-29 03:09:27 UTC) #3
Tom Sepez
https://codereview.chromium.org/524443002/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/524443002/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode1384 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:1384: FX_DWORD gennum = FXSYS_atoi(word); nit: I'd call this real_gennum ...
6 years, 3 months ago (2014-08-29 17:28:01 UTC) #4
Tom Sepez
(or perhaps parsed_objnum and parsed_gennum).
6 years, 3 months ago (2014-08-29 20:17:19 UTC) #5
Bo Xu
https://codereview.chromium.org/524443002/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/524443002/diff/60001/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp#newcode1384 core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp:1384: FX_DWORD gennum = FXSYS_atoi(word); On 2014/08/29 17:28:01, Tom Sepez ...
6 years, 3 months ago (2014-09-19 21:48:19 UTC) #6
Tom Sepez
https://codereview.chromium.org/524443002/diff/80001/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/524443002/diff/80001/core/src/fxcrt/fx_basic_gcc.cpp#newcode27 core/src/fxcrt/fx_basic_gcc.cpp:27: break; On 2014/09/19 21:48:19, Bo Xu wrote: > Now ...
6 years, 3 months ago (2014-09-19 22:15:39 UTC) #7
Bo Xu
https://codereview.chromium.org/524443002/diff/80001/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/524443002/diff/80001/core/src/fxcrt/fx_basic_gcc.cpp#newcode27 core/src/fxcrt/fx_basic_gcc.cpp:27: break; On 2014/09/19 22:15:38, Tom Sepez wrote: > On ...
6 years, 3 months ago (2014-09-19 22:28:15 UTC) #8
Tom Sepez
Alternatively make a comparison of num to (std::numeric_limits<T>::max() - 9) / 10 *before* the multiply ...
6 years, 3 months ago (2014-09-19 22:31:47 UTC) #9
Tom Sepez
https://codereview.chromium.org/524443002/diff/100001/core/src/fxcrt/fx_basic_gcc.cpp File core/src/fxcrt/fx_basic_gcc.cpp (right): https://codereview.chromium.org/524443002/diff/100001/core/src/fxcrt/fx_basic_gcc.cpp#newcode19 core/src/fxcrt/fx_basic_gcc.cpp:19: base::CheckedNumeric<T> num = 0; num doesn't need to be ...
6 years, 3 months ago (2014-09-19 22:35:07 UTC) #10
Bo Xu
On 2014/09/19 22:31:47, Tom Sepez wrote: > Alternatively make a comparison of num to (std::numeric_limits<T>::max() ...
6 years, 3 months ago (2014-09-19 22:40:23 UTC) #11
Tom Sepez
lgtm
6 years, 3 months ago (2014-09-19 22:43:01 UTC) #12
Tom Sepez
(provided it compiles - you might want to #include <limits> explicitly).
6 years, 3 months ago (2014-09-19 22:47:02 UTC) #13
Bo Xu
On 2014/09/19 22:47:02, Tom Sepez wrote: > (provided it compiles - you might want to ...
6 years, 3 months ago (2014-09-19 22:55:40 UTC) #14
Tom Sepez
lgtm
6 years, 3 months ago (2014-09-19 22:56:31 UTC) #15
Bo Xu
6 years, 3 months ago (2014-09-19 22:58:49 UTC) #16
Message was sent while issue was closed.
Committed patchset #8 (id:140001) manually as 2d28224 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698