From 2c9cba136544dd305f5e83a120d4222d9a2b6c62 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Wed, 13 Jan 2016 21:57:47 -0800 Subject: Merge to XFA: Fix another invalidated iterator issue while traversing CPDF_Dictionary. TBR=thestig@chromium.org (cherry picked from commit a626e39700abe56e98bc44a97c38eb8da077065e) Review URL: https://codereview.chromium.org/1587723004 . --- core/src/fpdfdoc/doc_formcontrol.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/src/fpdfdoc') diff --git a/core/src/fpdfdoc/doc_formcontrol.cpp b/core/src/fpdfdoc/doc_formcontrol.cpp index 6c3d1ec9c4..bf37d85195 100644 --- a/core/src/fpdfdoc/doc_formcontrol.cpp +++ b/core/src/fpdfdoc/doc_formcontrol.cpp @@ -64,9 +64,11 @@ void CPDF_FormControl::SetOnStateName(const CFX_ByteString& csOn) { if (!pSubDict) continue; - for (const auto& subdict_it : *pSubDict) { - const CFX_ByteString& csKey2 = subdict_it.first; - CPDF_Object* pObj2 = subdict_it.second; + auto subdict_it = pSubDict->begin(); + while (subdict_it != pSubDict->end()) { + const CFX_ByteString& csKey2 = subdict_it->first; + CPDF_Object* pObj2 = subdict_it->second; + ++subdict_it; if (!pObj2) { continue; } -- cgit v1.2.3