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

Unified Diff: xfa/src/fxfa/src/app/xfa_fontmgr.cpp

Issue 1506423002: Fix heap-use-after-free in CXFA_PDFFontMgr::~CXFA_PDFFontMgr() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/app/xfa_fontmgr.cpp
diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
index 23a1b29c014152ee7bc8548df2e85802312a03ab..f63c4f281039c4abfbdd5b54f48c98731eb1f4ca 100644
--- a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
+++ b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp
@@ -1864,15 +1864,8 @@ CXFA_PDFFontMgr::CXFA_PDFFontMgr(CXFA_FFDoc* pDoc) {
m_pDoc = pDoc;
}
CXFA_PDFFontMgr::~CXFA_PDFFontMgr() {
- FX_POSITION ps = m_FDE2PDFFont.GetStartPosition();
- while (ps) {
- IFX_Font* pFDEFont;
- void* pPDFFont;
- m_FDE2PDFFont.GetNextAssoc(ps, (void*&)pFDEFont, pPDFFont);
- pFDEFont->SetFontProvider(NULL);
jun_fang 2015/12/09 13:29:08 We believe that PDFFontMgr always lives longer tha
- }
m_FDE2PDFFont.RemoveAll();
- ps = m_FontArray.GetStartPosition();
+ FX_POSITION ps = m_FontArray.GetStartPosition();
while (ps) {
CFX_ByteString strKey;
IFX_Font* pFont = NULL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698