diff options
author | Oliver Chang <ochang@chromium.org> | 2016-01-13 18:46:09 -0800 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2016-01-13 18:46:09 -0800 |
commit | bd292ae8c0ca1793e8824add13bc8231cec3bc75 (patch) | |
tree | f9c90ff5288681aa9d5550e23c5e278b6f794ab2 /fpdfsdk/src/fpdfppo.cpp | |
parent | 81ec24c0fe046dcb7006ce69682c731a09205231 (diff) | |
download | pdfium-bd292ae8c0ca1793e8824add13bc8231cec3bc75.tar.xz |
Merge to XFA: Fix some iterator invalidation issues while traversing CPDF_Dictionary.
Also fixes a potential issue in CPDF_Dictionary::ReplaceKey.
TBR=thestig@chromium.org
BUG=577030
Original Review URL: https://codereview.chromium.org/1582963003 .
(cherry picked from commit cae57daaa0f7ed4c92e22c4e7ef30392393d1128)
Review URL: https://codereview.chromium.org/1587703003 .
Diffstat (limited to 'fpdfsdk/src/fpdfppo.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfppo.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index dac548131e..47b91015a9 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -213,9 +213,11 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj, } case PDFOBJ_DICTIONARY: { CPDF_Dictionary* pDict = pObj->AsDictionary(); - for (const auto& it : *pDict) { - const CFX_ByteString& key = it.first; - CPDF_Object* pNextObj = it.second; + auto it = pDict->begin(); + while (it != pDict->end()) { + const CFX_ByteString& key = it->first; + CPDF_Object* pNextObj = it->second; + ++it; if (!FXSYS_strcmp(key, "Parent") || !FXSYS_strcmp(key, "Prev") || !FXSYS_strcmp(key, "First")) { continue; |