Skip to content

Commit

Permalink
fix: raise error on character reference outside CHAR production
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Jul 4, 2018
1 parent 04e1593 commit 30fb540
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ class SAXParser {
}
}

if (Number.isNaN(num)) {
if (Number.isNaN(num) || num > 0x10FFFF) {
this.fail("Invalid character entity");
return `&${this.entity};`;
}
Expand Down
3 changes: 2 additions & 1 deletion test/conformance.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class SaxesDriver extends BaseDriver {
errors.push(err);
};

parser.close(source);
parser.write(source);
parser.end();
this.processResult(test, handling, errors.length === 0);
});
}
Expand Down

0 comments on commit 30fb540

Please sign in to comment.