summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/pdfium/fxjs/cjs_document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/pdfium/fxjs/cjs_document.cpp')
-rw-r--r--chromium/third_party/pdfium/fxjs/cjs_document.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/chromium/third_party/pdfium/fxjs/cjs_document.cpp b/chromium/third_party/pdfium/fxjs/cjs_document.cpp
index 6e2f2da6c60..ff9cfc394d6 100644
--- a/chromium/third_party/pdfium/fxjs/cjs_document.cpp
+++ b/chromium/third_party/pdfium/fxjs/cjs_document.cpp
@@ -744,8 +744,9 @@ CJS_Result CJS_Document::get_info(CJS_Runtime* pRuntime) {
pRuntime->PutObjectProperty(pObj, L"Trapped",
pRuntime->NewString(cwTrapped.AsStringView()));
- // It's to be compatible to non-standard info dictionary.
- for (const auto& it : *pDictionary) {
+ // PutObjectProperty() calls below may re-enter JS and change info dict.
+ auto pCopy = pDictionary->Clone();
+ for (const auto& it : *ToDictionary(pCopy.get())) {
const ByteString& bsKey = it.first;
CPDF_Object* pValueObj = it.second.get();
WideString wsKey = WideString::FromUTF8(bsKey.AsStringView());