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

Unified Diff: fpdfsdk/src/fpdfppo.cpp

Issue 1582963003: Fix some iterator invalidation issues while traversing CPDF_Dictionary. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase, use Lei's fix Created 4 years, 11 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 | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfppo.cpp
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index dac548131e7596292bf3e3f795231718d0e08b0a..47b91015a9d41639cae4577c017f0e061f840976 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;
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698