From 3b1707f50e4961c2a350243acbeaaafd89e22fca Mon Sep 17 00:00:00 2001 From: Jun Fang Date: Wed, 9 Dec 2015 20:07:18 -0800 Subject: Fix heap-use-after-free in CXFA_PDFFontMgr::~CXFA_PDFFontMgr() BUG=pdfium:306 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1506423002 . --- xfa/src/fxfa/src/app/xfa_fontmgr.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'xfa') diff --git a/xfa/src/fxfa/src/app/xfa_fontmgr.cpp b/xfa/src/fxfa/src/app/xfa_fontmgr.cpp index 23a1b29c01..f63c4f2810 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); - } m_FDE2PDFFont.RemoveAll(); - ps = m_FontArray.GetStartPosition(); + FX_POSITION ps = m_FontArray.GetStartPosition(); while (ps) { CFX_ByteString strKey; IFX_Font* pFont = NULL; -- cgit v1.2.3