1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

XFA - Avoid infinite loop when creating some nodes in data

This commit is contained in:
Calixte Denizet 2021-06-09 18:56:16 +02:00
parent 63bde1fcfe
commit cddc1d869d
3 changed files with 70 additions and 2 deletions

View file

@ -526,7 +526,10 @@ class Binder {
if (this._isConsumeData()) {
match[$consumed] = true;
}
match = [match];
// Don't bind the value in newly created node because it's empty.
this._bindElement(child, match);
continue;
} else {
if (this._isConsumeData()) {
// Filter out consumed nodes.

View file

@ -245,7 +245,7 @@ function searchNode(
function createNodes(root, path) {
let node = null;
for (const { name, index } of path) {
for (let i = 0; i <= index; i++) {
for (let i = 0, ii = !isFinite(index) ? 0 : index; i <= ii; i++) {
node = new XmlObject(root[$namespaceId], name);
root[$appendChild](node);
}