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

Unified Diff: core/fxcrt/fx_basic_list.cpp

Issue 1991123002: Fix a potential nullptr deref in CFX_MapPtrToPtr. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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 | « no previous file | core/fxcrt/fx_basic_maps.cpp » ('j') | core/fxcrt/fx_basic_maps.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_list.cpp
diff --git a/core/fxcrt/fx_basic_list.cpp b/core/fxcrt/fx_basic_list.cpp
index 02afd471124acc57734c9f4c389d9cf60f93498e..800a22c09ba91b540140e7fcc0c4ee54cdd3e29c 100644
--- a/core/fxcrt/fx_basic_list.cpp
+++ b/core/fxcrt/fx_basic_list.cpp
@@ -76,7 +76,8 @@ void CFX_PtrList::FreeNode(CFX_PtrList::CNode* pNode) {
void CFX_PtrList::RemoveAll() {
m_nCount = 0;
m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL;
Tom Sepez 2016/05/19 17:02:01 nit: one per pline.
Lei Zhang 2016/05/19 20:48:50 Done.
- m_pBlocks->FreeDataChain();
+ if (m_pBlocks)
Tom Sepez 2016/05/19 17:02:01 Ah, idempotency. Nit: As long as we're going to t
Lei Zhang 2016/05/19 20:48:50 Done.
+ m_pBlocks->FreeDataChain();
m_pBlocks = NULL;
Tom Sepez 2016/05/19 17:02:01 nit: nullptr, also above.
Lei Zhang 2016/05/19 20:48:50 Done.
}
CFX_PtrList::CNode* CFX_PtrList::NewNode(CFX_PtrList::CNode* pPrev,
« no previous file with comments | « no previous file | core/fxcrt/fx_basic_maps.cpp » ('j') | core/fxcrt/fx_basic_maps.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698