diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-08-30 11:22:58 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-08-30 11:22:58 -0400 |
commit | b48a715c301758ff66a96f74e3921c121b317603 (patch) | |
tree | 91aa2e51b8b7c99e9e98620d4f2d7fe766afec69 /core/include/fpdfapi | |
parent | fe9485fff248dd04a0643e4ce2309aec7ae237e1 (diff) | |
download | pdfium-chromium/2785.tar.xz |
[Merge to M53] Fixup integer conversion logic.chromium/2785
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)
Review URL: https://codereview.chromium.org/2291183002 .
Diffstat (limited to 'core/include/fpdfapi')
0 files changed, 0 insertions, 0 deletions