Language: JavaScript
Label: safe
CWE: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Code:
y=0;y<m;++y){for(var F=1024*y,C=Math.min(F+1024,g),H=Array(C-F),G=0;F<C;++G,++F)H[G]=d[F].charCodeAt(0);q[y]=new Uint8Array(H)}return new Blob(q,{type:f})};EditorUi.prototype.saveLocalFile=function(d,f,g,m,q,y,F,C){y=null!=y?y:!1;F=null!=F?F:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);q=this.getServiceCount(y);isLocalStorage&&q++;var H=4>=q?2:6<q?4:3;f=new CreateDialog(this,f,mxUtils.bind(this,function(G,aa){try{if("_blank"==aa)if(null!=g&&"image/"==g.substring(0,6))this.openInNewWindow(d,
g,m);else if(null!=g&&"text/html"==g.substring(0,9)){var da=new EmbedDialog(this,d);this.showDialog(da.container,450,240,!0,!0);da.init()}else{var ba=window.open("about:blank");null==ba?mxUtils.popup(d,!0):(ba.document.write("<pre>"+mxUtils.htmlEntities(d,!1)+"</pre>"),ba.document.close())}else aa==App.MODE_DEVICE||"download"==aa?this.doSaveLocalFile(d,G,g,m,null,C):null!=G&&0<G.length&&this.pickFolder(aa,mxUtils.bind(this,function(Y){try{this.exportFile(d,G,g,m,aa,Y)}catch(qa){this.handleError(qa)}}))}catch(Y){this.handleError(Y)}}),
mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,y,F,null,1<q,H,d,g,m);y=this.isServices(q)?q>H?390:280:160;this.showDialog(f.container,420,y,!0,!0);f.init()};EditorUi.prototype.openInNewWindow=function(d,f,g){var m=window.open("about:blank");null==m||null==m.document?mxUtils.popup(d,!0):("image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"==f?m.document.write("<html>"+d+"</html>"):(d=g?d:btoa(unescape(encodeURIComponent(d))),m.document.write('<html><img style="max-width:100%;" src="data:'+