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

Issue 2291183002: [Merge to M53] Fixup integer conversion logic. (Closed)

Created:
4 years, 3 months ago by dsinclair
Modified:
4 years, 3 months ago
Reviewers:
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/chromium/2785
Project:
pdfium
Visibility:
Public.

Description

[Merge to M53] Fixup integer conversion logic. In bc8a64029f898286c3dcad3a6cecdc98ef30b139 we updated the FX_atonum logic to correctly handle integer overflow. This causes issues when parsing the Permissions flag of encrypted documents as that flag isn't encoded like other numbers. The Permissions flag is a unsigned value, and has to be treated as such since the sign bit is always set. The current logic will detect an overflow of the int value and return 0. The old logic would have detected the overflow and returned the negative result regardless. This CL updates the logic to do the string to int conversion as a uint32_t and then verifies the uint32_t value, if a sign was provided, fits within the int range, otherwise it converts it to an int and lets it be positive or negative as needed. Merge clean TBRing. BUG=pdfium:539, chromium:642256 TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2168173002 (cherry picked from commit 6f1025492801aaa93fca2c0ed7c40a3389ad8cd1) Committed: https://pdfium.googlesource.com/pdfium/+/b48a715c301758ff66a96f74e3921c121b317603

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -4 lines) Patch
M core/fxcrt/fx_basic_util.cpp View 2 chunks +37 lines, -4 lines 0 comments Download
M core/fxcrt/fx_basic_util_unittest.cpp View 2 chunks +47 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (6 generated)
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/2291183002/1
4 years, 3 months ago (2016-08-30 15:21:19 UTC) #4
commit-bot: I haz the power
CLs for remote refs other than refs/heads/master must contain NOTRY=true and NOPRESUBMIT=true in order for ...
4 years, 3 months ago (2016-08-30 15:21:20 UTC) #6
dsinclair
4 years, 3 months ago (2016-08-30 15:23:04 UTC) #9
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
b48a715c301758ff66a96f74e3921c121b317603 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698