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

Unified Diff: core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp

Issue 2358023002: Check for overflow in CMap_GetCode. (Closed)
Patch Set: Review feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp
index ccf49ee46a3d290b1789d52943a721cfbcf072a1..9564a972e7610d0419c90a6e2420f42159e176dd 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid_unittest.cpp
@@ -28,6 +28,10 @@ TEST(fpdf_font_cid, CMap_GetCode) {
EXPECT_EQ(12u, CPDF_CMapParser::CMap_GetCode("12"));
EXPECT_EQ(12u, CPDF_CMapParser::CMap_GetCode("12d"));
EXPECT_EQ(128u, CPDF_CMapParser::CMap_GetCode("128"));
+
+ // Overflow a uint32_t.
+ EXPECT_EQ(0u, CPDF_CMapParser::CMap_GetCode("<FFFFFFFFa"));
Tom Sepez 2016/09/21 18:58:13 nit: how about 100000000, the first thing that ove
dsinclair 2016/09/21 19:00:32 Done.
+ EXPECT_EQ(4294967295u, CPDF_CMapParser::CMap_GetCode("<FFFFFFFF"));
Tom Sepez 2016/09/21 18:58:13 nit: this should come before the case at line 33 s
dsinclair 2016/09/21 19:00:32 Done.
}
TEST(fpdf_font_cid, CMap_GetCodeRange) {
« no previous file with comments | « core/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698