summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2016-01-13 21:57:47 -0800
committerOliver Chang <ochang@chromium.org>2016-01-13 21:57:47 -0800
commit2c9cba136544dd305f5e83a120d4222d9a2b6c62 (patch)
tree8f9e758e2b59be83d140a5d9978f3bb7ccb986f5 /core/src/fpdfdoc
parentf2663fecb894d447dfc9b4b04b4477eca5b557b7 (diff)
downloadpdfium-2c9cba136544dd305f5e83a120d4222d9a2b6c62.tar.xz
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 .
Diffstat (limited to 'core/src/fpdfdoc')
-rw-r--r--core/src/fpdfdoc/doc_formcontrol.cpp8
1 files changed, 5 insertions, 3 deletions
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;
}