From 2c115d829d3560fd5082500c552dfe38850881ec Mon Sep 17 00:00:00 2001 From: Jun Fang Date: Tue, 23 Feb 2016 09:36:10 +0800 Subject: Resolve heap-use-after-free in CFX_WideString::~CFX_WideString() BUG=pdfium:402 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1719803002 . --- xfa/src/fwl/src/lightwidget/listbox.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'xfa/src/fwl') diff --git a/xfa/src/fwl/src/lightwidget/listbox.cpp b/xfa/src/fwl/src/lightwidget/listbox.cpp index 62e25cc36d..eb212fadca 100644 --- a/xfa/src/fwl/src/lightwidget/listbox.cpp +++ b/xfa/src/fwl/src/lightwidget/listbox.cpp @@ -63,18 +63,10 @@ FX_BOOL CFWL_ListBox::DeleteString(FWL_HLISTITEM hItem) { pSel->m_dwStates |= FWL_ITEMSTATE_LTB_Selected; } m_ListBoxDP.m_ItemArray.erase(m_ListBoxDP.m_ItemArray.begin() + nIndex); - delete pDelItem; return TRUE; } -FX_BOOL CFWL_ListBox::DeleteAll() { - size_t iCount = m_ListBoxDP.CountItems(m_pIface); - for (size_t i = 0; i < iCount; ++i) { - CFWL_ListItem* pItem = - reinterpret_cast(m_ListBoxDP.GetItem(m_pIface, i)); - delete pItem; - } +void CFWL_ListBox::DeleteAll() { m_ListBoxDP.m_ItemArray.clear(); - return TRUE; } int32_t CFWL_ListBox::CountSelItems() { if (!m_pIface) -- cgit v1.2.3