mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #13527 from calixteman/bind_inf_loop
XFA - Avoid infinite loop when creating some nodes in data
This commit is contained in:
commit
d333af7848
3 changed files with 70 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue