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

Issue 2223823003: Guard against undefined shift. (Closed)

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

Description

Guard against undefined shift. This Cl fixes the CFDE_XMLSyntaxParser::ParseTextChar() to handle entities where the value goes negative. Currently this could cause an undefined-shift as due to the (ch << 4) calls. Instead, detect if the value has gone negative and return a space character. BUG=chromium:603489 Committed: https://pdfium.googlesource.com/pdfium/+/22eeccb34f91f9932f7cec295bcaf641ba249e3a

Patch Set 1 #

Patch Set 2 : Make windows happy? #

Patch Set 3 : Special case windows #

Patch Set 4 : sigh #

Total comments: 3

Patch Set 5 : Handle overflow by length #

Patch Set 6 : Update windows result #

Total comments: 4

Patch Set 7 : Do calculation in uint32 space #

Total comments: 2

Patch Set 8 : cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -9 lines) Patch
M xfa/fde/xml/fde_xml_imp.cpp View 1 2 3 4 5 6 7 4 chunks +14 lines, -9 lines 0 comments Download
M xfa/fde/xml/fde_xml_imp_unittest.cpp View 1 2 3 4 5 6 7 1 chunk +123 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (31 generated)
dsinclair
PTAL.
4 years, 4 months ago (2016-08-08 13:53:36 UTC) #4
Wei Li
https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp#newcode1871 xfa/fde/xml/fde_xml_imp.cpp:1871: if (ch < 0) { Should we check overflow ...
4 years, 4 months ago (2016-08-08 22:38:52 UTC) #17
dsinclair
https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp#newcode1871 xfa/fde/xml/fde_xml_imp.cpp:1871: if (ch < 0) { On 2016/08/08 22:38:52, Wei ...
4 years, 4 months ago (2016-08-09 00:21:51 UTC) #18
dsinclair
https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp#newcode1871 xfa/fde/xml/fde_xml_imp.cpp:1871: if (ch < 0) { On 2016/08/08 22:38:52, Wei ...
4 years, 4 months ago (2016-08-09 14:33:33 UTC) #20
Wei Li
On 2016/08/09 14:33:33, dsinclair wrote: > https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp > File xfa/fde/xml/fde_xml_imp.cpp (right): > > https://codereview.chromium.org/2223823003/diff/60001/xfa/fde/xml/fde_xml_imp.cpp#newcode1871 > ...
4 years, 4 months ago (2016-08-09 17:08:37 UTC) #21
dsinclair
On 2016/08/09 17:08:37, Wei Li wrote: > On 2016/08/09 14:33:33, dsinclair wrote: > > > ...
4 years, 4 months ago (2016-08-09 17:19:03 UTC) #22
Wei Li
On 2016/08/09 17:19:03, dsinclair wrote: > On 2016/08/09 17:08:37, Wei Li wrote: > > On ...
4 years, 4 months ago (2016-08-09 17:25:27 UTC) #23
dsinclair
On 2016/08/09 17:25:27, Wei Li wrote: > On 2016/08/09 17:19:03, dsinclair wrote: > > On ...
4 years, 4 months ago (2016-08-09 17:31:35 UTC) #24
dsinclair
PTAL.
4 years, 4 months ago (2016-08-09 20:02:18 UTC) #27
dsinclair
And, I broke Windows again. Will ping when the tests pass on Win.
4 years, 4 months ago (2016-08-09 20:07:32 UTC) #28
dsinclair
PTAL.
4 years, 4 months ago (2016-08-10 15:17:21 UTC) #35
Wei Li
https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp#newcode1886 xfa/fde/xml/fde_xml_imp.cpp:1886: if (ch < 0) { Could you also use ...
4 years, 4 months ago (2016-08-10 17:28:31 UTC) #36
dsinclair
https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp#newcode1886 xfa/fde/xml/fde_xml_imp.cpp:1886: if (ch < 0) { On 2016/08/10 17:28:30, Wei ...
4 years, 4 months ago (2016-08-10 17:31:04 UTC) #37
Wei Li
https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp#newcode1886 xfa/fde/xml/fde_xml_imp.cpp:1886: if (ch < 0) { On 2016/08/10 17:31:04, dsinclair ...
4 years, 4 months ago (2016-08-10 20:18:49 UTC) #38
dsinclair
https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/120001/xfa/fde/xml/fde_xml_imp.cpp#newcode1886 xfa/fde/xml/fde_xml_imp.cpp:1886: if (ch < 0) { On 2016/08/10 20:18:48, Wei ...
4 years, 4 months ago (2016-08-10 20:58:09 UTC) #41
Wei Li
lgtm https://codereview.chromium.org/2223823003/diff/140001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/140001/xfa/fde/xml/fde_xml_imp.cpp#newcode1865 xfa/fde/xml/fde_xml_imp.cpp:1865: if (iLen - i <= 4) { Now, ...
4 years, 4 months ago (2016-08-10 21:03:58 UTC) #44
dsinclair
https://codereview.chromium.org/2223823003/diff/140001/xfa/fde/xml/fde_xml_imp.cpp File xfa/fde/xml/fde_xml_imp.cpp (right): https://codereview.chromium.org/2223823003/diff/140001/xfa/fde/xml/fde_xml_imp.cpp#newcode1865 xfa/fde/xml/fde_xml_imp.cpp:1865: if (iLen - i <= 4) { On 2016/08/10 ...
4 years, 4 months ago (2016-08-11 14:30:39 UTC) #45
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/2223823003/160001
4 years, 4 months ago (2016-08-11 14:30:54 UTC) #48
commit-bot: I haz the power
4 years, 4 months ago (2016-08-11 14:50:18 UTC) #50
Message was sent while issue was closed.
Committed patchset #8 (id:160001) as
https://pdfium.googlesource.com/pdfium/+/22eeccb34f91f9932f7cec295bcaf641ba24...

Powered by Google App Engine
This is Rietveld 408576698