New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite-loop error #98
Comments
Adding help wanted & needs-investigation labels. Maybe related to these:
|
Hi @brodybits I've taken a look at this to see where some potential issues with input sanitation might lie. The The
It's possible to get the parser to bail out early - passing an errorHandler implementation should do the trick. const { DOMParser } = require('xmldom');
try {
const parser = new DOMParser({
errorHandler: {
error: errorMessage => {
throw new Error(errorMessage);
}
}
});
parser.parseFromString({});
} catch (error) {
console.error(`Caught something!`, error);
} In terms of fixing this, perhaps:
|
Wow, great research and findings! Looking closer at the whole loop and error handling might also help us to fix other bugs. |
Cheers - I'd be happy to have a go at fixing this, would you guys be alright with me raising a PR? |
A PR would be much appreciated, thanks. |
When passing an object to DOMParser's
parseFromString
you'll get infinetely looping error:Obviously you shouldn't pass an object there, but still this should be fixed.
The text was updated successfully, but these errors were encountered: