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

Issue 395303004: Fix bounds checking in CJS_PublicMethods::MakeRegularDate(). (Closed)

Created:
6 years, 5 months ago by Tom Sepez
Modified:
6 years, 5 months ago
Reviewers:
jam, jun_fang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Visibility:
Public.

Description

Fix bounds checking in CJS_PublicMethods::MakeRegularDate(). The function is looking ahead N characters at both its "format" and "value" strings without validating that accesses are in bounds. Add those validations. There are also duplicate checks in the else-branches which re-test the inverse of the if-branch. These are removed for simplicity. I also tidied some stray whitespace in the function while I was at it. BUG=393831 R=jun_fang@foxitsoftware.com Committed: https://pdfium.googlesource.com/pdfium/+/5ffacd6

Patch Set 1 #

Total comments: 7

Patch Set 2 : Fix whitespace. #

Patch Set 3 : Re-tabify to more closely match conventions used in file. #

Patch Set 4 : use == vs <. #

Patch Set 5 : Add myself to AUTHORS file. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -17 lines) Patch
M AUTHORS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M fpdfsdk/src/javascript/PublicMethods.cpp View 1 2 3 13 chunks +18 lines, -17 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Tom Sepez
John, Jun, Please review. Thanks.
6 years, 5 months ago (2014-07-16 21:54:59 UTC) #1
jam
On 2014/07/16 21:54:59, Tom Sepez wrote: > John, Jun, Please review. Thanks. I defer to ...
6 years, 5 months ago (2014-07-17 17:43:27 UTC) #2
jun_fang
https://codereview.chromium.org/395303004/diff/1/fpdfsdk/src/javascript/PublicMethods.cpp File fpdfsdk/src/javascript/PublicMethods.cpp (right): https://codereview.chromium.org/395303004/diff/1/fpdfsdk/src/javascript/PublicMethods.cpp#newcode658 fpdfsdk/src/javascript/PublicMethods.cpp:658: int remaining = format.GetLength() - i - 1; should ...
6 years, 5 months ago (2014-07-18 17:30:59 UTC) #3
Tom Sepez
https://codereview.chromium.org/395303004/diff/1/fpdfsdk/src/javascript/PublicMethods.cpp File fpdfsdk/src/javascript/PublicMethods.cpp (right): https://codereview.chromium.org/395303004/diff/1/fpdfsdk/src/javascript/PublicMethods.cpp#newcode658 fpdfsdk/src/javascript/PublicMethods.cpp:658: int remaining = format.GetLength() - i - 1; On ...
6 years, 5 months ago (2014-07-18 18:00:05 UTC) #4
jun_fang
On 2014/07/18 18:00:05, Tom Sepez wrote: > https://codereview.chromium.org/395303004/diff/1/fpdfsdk/src/javascript/PublicMethods.cpp > File fpdfsdk/src/javascript/PublicMethods.cpp (right): > > https://codereview.chromium.org/395303004/diff/1/fpdfsdk/src/javascript/PublicMethods.cpp#newcode658 ...
6 years, 5 months ago (2014-07-18 18:21:00 UTC) #5
Tom Sepez
Yes. You are right. Another concern is that when you use 'remaining < 4', it ...
6 years, 5 months ago (2014-07-18 18:25:01 UTC) #6
jun_fang
On 2014/07/18 18:25:01, Tom Sepez wrote: > Yes. You are right. Another concern is that ...
6 years, 5 months ago (2014-07-18 19:42:17 UTC) #7
Tom Sepez
6 years, 5 months ago (2014-07-18 21:42:17 UTC) #8
Message was sent while issue was closed.
Committed patchset #5 manually as r5ffacd6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698