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

Issue 2358023002: Check for overflow in CMap_GetCode. (Closed)

Created:
4 years, 3 months ago by dsinclair
Modified:
4 years, 3 months ago
Reviewers:
Tom Sepez, Wei Li
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Check for overflow in CMap_GetCode. Given a large enough value for the character code it's possible to overflow the conversion to an int. This Cl updates the code to guard against overflow. BUG=chromium:648739 Committed: https://pdfium.googlesource.com/pdfium/+/c0f60dc29db66262bbc0082fcd51170a570b0d1f

Patch Set 1 #

Total comments: 11

Patch Set 2 : Review feedback #

Total comments: 4

Patch Set 3 : Review fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -5 lines) Patch
M core/fpdfapi/fpdf_font/fpdf_font_cid.cpp View 1 1 chunk +11 lines, -5 lines 0 comments Download
M core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp View 1 2 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (12 generated)
dsinclair
PTAL. https://codereview.chromium.org/2358023002/diff/1/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp File core/fpdfapi/fpdf_font/fpdf_font_cid.cpp (right): https://codereview.chromium.org/2358023002/diff/1/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp#newcode444 core/fpdfapi/fpdf_font/fpdf_font_cid.cpp:444: pdfium::base::CheckedNumeric<uint32_t> num = 0; The method returns a ...
4 years, 3 months ago (2016-09-21 14:56:33 UTC) #4
Tom Sepez
https://codereview.chromium.org/2358023002/diff/1/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp File core/fpdfapi/fpdf_font/fpdf_font_cid.cpp (right): https://codereview.chromium.org/2358023002/diff/1/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp#newcode444 core/fpdfapi/fpdf_font/fpdf_font_cid.cpp:444: pdfium::base::CheckedNumeric<uint32_t> num = 0; On 2016/09/21 14:56:33, dsinclair wrote: ...
4 years, 3 months ago (2016-09-21 16:48:51 UTC) #7
dsinclair
https://codereview.chromium.org/2358023002/diff/1/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp File core/fpdfapi/fpdf_font/fpdf_font_cid.cpp (right): https://codereview.chromium.org/2358023002/diff/1/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp#newcode444 core/fpdfapi/fpdf_font/fpdf_font_cid.cpp:444: pdfium::base::CheckedNumeric<uint32_t> num = 0; On 2016/09/21 16:48:51, Tom Sepez ...
4 years, 3 months ago (2016-09-21 17:16:55 UTC) #8
Tom Sepez
lgtm https://codereview.chromium.org/2358023002/diff/20001/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp File core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp (right): https://codereview.chromium.org/2358023002/diff/20001/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp#newcode33 core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp:33: EXPECT_EQ(0u, CPDF_CMapParser::CMap_GetCode("<FFFFFFFFa")); nit: how about 100000000, the first ...
4 years, 3 months ago (2016-09-21 18:58:13 UTC) #13
dsinclair
https://codereview.chromium.org/2358023002/diff/20001/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp File core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp (right): https://codereview.chromium.org/2358023002/diff/20001/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp#newcode33 core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp:33: EXPECT_EQ(0u, CPDF_CMapParser::CMap_GetCode("<FFFFFFFFa")); On 2016/09/21 18:58:13, Tom Sepez wrote: > ...
4 years, 3 months ago (2016-09-21 19:00:32 UTC) #14
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/2358023002/40001
4 years, 3 months ago (2016-09-21 19:00:44 UTC) #17
commit-bot: I haz the power
4 years, 3 months ago (2016-09-21 19:49:38 UTC) #19
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://pdfium.googlesource.com/pdfium/+/c0f60dc29db66262bbc0082fcd51170a570b...

Powered by Google App Engine
This is Rietveld 408576698