Skip to content

Commit

Permalink
Merge pull request #2 from slimjimsoftware/fix-unlclosed-cdata-causin…
Browse files Browse the repository at this point in the history
…g-oom-crash

fix oom crash when cdata tag unclosed
  • Loading branch information
slimjimsoftware authored Nov 1, 2019
2 parents 27cfc3b + a90eb36 commit 9a949f0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/ace/mode/xml/sax.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,15 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
default:
if(source.substr(start+3,6) == 'CDATA['){
var end = source.indexOf(']]>',start+9);
domBuilder.startCDATA();
domBuilder.characters(source,start+9,end-start-9);
domBuilder.endCDATA()
return end+3;
if (end > start) {
domBuilder.startCDATA();
domBuilder.characters(source,start+9,end-start-9);
domBuilder.endCDATA()
return end+3;
} else {
errorHandler.error("Unclosed CDATA");
return -1;
}
}
//<!DOCTYPE
//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
Expand Down

0 comments on commit 9a949f0

Please sign in to comment.