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

Issue 2384853002: Detect resursive loading of type3 font char to avoid infinite loop (Closed)

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

Description

Detect resursive loading of type3 font char to avoid infinite loop The original way of detecting loops was passing a level parameter through various functions. This missed some cases which also lead to load type3 font char, for example, FindFont() may call CheckType3FontMetrics() which may eventually lead to LoadChar(). The new way is to store the char loading depth, and abort when the depth exceeds the max. BUG=chromium:651304 Committed: https://pdfium.googlesource.com/pdfium/+/d61f958385be285f3f3897ef3a3f010048608f1c

Patch Set 1 #

Patch Set 2 : tidy #

Total comments: 4

Patch Set 3 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -29 lines) Patch
M core/fpdfapi/fpdf_font/cpdf_cidfont.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_cidfont.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_font.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_simplefont.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_simplefont.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_type3font.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_type3font.cpp View 1 2 4 chunks +11 lines, -8 lines 0 comments Download
M core/fpdfapi/fpdf_page/cpdf_textobject.h View 1 chunk +1 line, -2 lines 0 comments Download
M core/fpdfapi/fpdf_page/cpdf_textobject.cpp View 4 chunks +4 lines, -5 lines 0 comments Download
M core/fpdfapi/fpdf_page/fpdf_page_parser.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (15 generated)
Wei Li
pls review, thanks
4 years, 2 months ago (2016-10-01 00:51:21 UTC) #6
Lei Zhang
4 years, 2 months ago (2016-10-01 00:53:55 UTC) #8
dsinclair
https://codereview.chromium.org/2384853002/diff/60001/core/fpdfapi/fpdf_font/cpdf_type3font.cpp File core/fpdfapi/fpdf_font/cpdf_type3font.cpp (left): https://codereview.chromium.org/2384853002/diff/60001/core/fpdfapi/fpdf_font/cpdf_type3font.cpp#oldcode91 core/fpdfapi/fpdf_font/cpdf_type3font.cpp:91: if (level >= _FPDF_MAX_TYPE3_FORM_LEVEL_) I don't see any other ...
4 years, 2 months ago (2016-10-03 13:01:03 UTC) #11
Wei Li
ptal, thanks https://codereview.chromium.org/2384853002/diff/60001/core/fpdfapi/fpdf_font/cpdf_type3font.cpp File core/fpdfapi/fpdf_font/cpdf_type3font.cpp (left): https://codereview.chromium.org/2384853002/diff/60001/core/fpdfapi/fpdf_font/cpdf_type3font.cpp#oldcode91 core/fpdfapi/fpdf_font/cpdf_type3font.cpp:91: if (level >= _FPDF_MAX_TYPE3_FORM_LEVEL_) On 2016/10/03 13:01:02, ...
4 years, 2 months ago (2016-10-03 18:56:31 UTC) #16
dsinclair
lgtm
4 years, 2 months ago (2016-10-03 19:10:34 UTC) #19
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/2384853002/80001
4 years, 2 months ago (2016-10-03 19:10:46 UTC) #20
commit-bot: I haz the power
4 years, 2 months ago (2016-10-03 19:10:58 UTC) #22
Message was sent while issue was closed.
Committed patchset #3 (id:80001) as
https://pdfium.googlesource.com/pdfium/+/d61f958385be285f3f3897ef3a3f01004860...

Powered by Google App Engine
This is Rietveld 408576698