Skip to content
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

Crash under input xml string which should catch as err #81

Open
yutongp opened this issue Apr 9, 2014 · 1 comment
Open

Crash under input xml string which should catch as err #81

yutongp opened this issue Apr 9, 2014 · 1 comment

Comments

@yutongp
Copy link

yutongp commented Apr 9, 2014

Following code crashes:

var doc = new xmldom.DOMParser({
      errorHandler:function(key,msg){
      console.log(key, msg);
    }
}).parseFromString('<!', 'text/xml');

with err msg:

xmldom/sax.js:480
    var len = matchs.length;
                    ^
TypeError: Cannot read property 'length' of undefined
    at parseDCC (node_modules/xmldom/sax.js:480:19)
    at parse (node_modules/xmldom/sax.js:122:10)
    at Object.XMLReader.parse (node_modules/xmldom/sax.js:30:3)
    at DOMParser.parseFromString (node_modules/xmldom/dom-parser.js:25:7)
@yutongp
Copy link
Author

yutongp commented Apr 9, 2014

And here is another one:

var doc = new xmldom.DOMParser({
  errorHandler:function(key,msg){
    console.log(key, msg);
  }
}).parseFromString('</', 'text/xml');

error:

fatalError end tag name: </ is not match the current start tagName:undefined
@#[line:undefined,col:undefined]

node_modules/xmldom/dom-parser.js:113
    var tagName = current.tagName;
                         ^
TypeError: Cannot read property 'tagName' of undefined
at Object.DOMHandler.endElement (node_modules/xmldom/dom-parser.js:113:27)
at parse (node_modules/xmldom/sax.js:107:15)
at Object.XMLReader.parse (node_modules/xmldom/sax.js:30:3)
at DOMParser.parseFromString (node_modules/xmldom/dom-parser.js:25:7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant