summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-17 17:57:51 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-17 17:57:51 +0000
commit5ae6c564d16ce8b625df3d1950abc822f9ecc987 (patch)
tree96bb64df3166e46db397e405789588bf8dc53842 /xfa
parent785a26dc649af80c593f899a606dff4dae7c48fd (diff)
downloadpdfium-5ae6c564d16ce8b625df3d1950abc822f9ecc987.tar.xz
Add CPDF_{Array,Dictionary}Locker to catch illegal iteration patterns.
Move begin/end methods onto locker object which tracks whether iterators are in existence. Change-Id: Ia869f313fce48d10a0d0180d0cc083eed6ea1584 Reviewed-on: https://pdfium-review.googlesource.com/c/44070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fgas/font/cfgas_pdffontmgr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/xfa/fgas/font/cfgas_pdffontmgr.cpp b/xfa/fgas/font/cfgas_pdffontmgr.cpp
index fe4b83ce4c..c1d6ada7a9 100644
--- a/xfa/fgas/font/cfgas_pdffontmgr.cpp
+++ b/xfa/fgas/font/cfgas_pdffontmgr.cpp
@@ -48,7 +48,9 @@ RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::FindFont(const ByteString& strPsName,
ByteString name = strPsName;
name.Remove(' ');
- for (const auto& it : *pFontSetDict) {
+
+ CPDF_DictionaryLocker locker(pFontSetDict);
+ for (const auto& it : locker) {
const ByteString& key = it.first;
CPDF_Object* pObj = it.second.get();
if (!PsNameMatchDRFontName(name.AsStringView(), bBold, bItalic, key,