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:
function(d,f,g,m){if(!mxEvent.isConsumed(d)){var q=f,y=!1;if(g&&null!=d.clipboardData&&d.clipboardData.getData){var F=d.clipboardData.getData("text/plain"),C=!1;if(null!=F&&0<F.length&&"%3CmxGraphModel%3E"==F.substring(0,18))try{var H=decodeURIComponent(F);this.isCompatibleString(H)&&(C=!0,F=H)}catch(da){}C=C?null:d.clipboardData.getData("text/html");null!=C&&0<C.length?(q=this.parseHtmlData(C),y="text/plain"!=q.getAttribute("data-type")):null!=F&&0<F.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,
C))}F=q.getElementsByTagName("span");if(null!=F&&0<F.length&&"application/vnd.lucid.chart.objects"===F[0].getAttribute("data-lucid-type"))g=F[0].getAttribute("data-lucid-content"),null!=g&&0<g.length&&(this.convertLucidChart(g,mxUtils.bind(this,function(da){var ba=this.editor.graph;ba.lastPasteXml==da?ba.pasteCounter++:(ba.lastPasteXml=da,ba.pasteCounter=0);var Y=ba.pasteCounter*ba.gridSize;ba.setSelectionCells(this.importXml(da,Y,Y));ba.scrollCellToVisible(ba.getSelectionCell())}),mxUtils.bind(this,
function(da){this.handleError(da)})),mxEvent.consume(d));else{y=y?q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);C=!1;try{var G=y.lastIndexOf("%3E");0<=G&&G<y.length-3&&(y=y.substring(0,G+3))}catch(da){}try{F=q.getElementsByTagName("span"),(H=null!=F&&0<F.length?mxUtils.trim(decodeURIComponent(F[0].textContent)):decodeURIComponent(y))&&(this.isCompatibleString(H)||0==H.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(C=!0,y=H)}catch(da){}try{if(null!=
y&&0<y.length){if(0==y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))try{"undefined"!==typeof MiroImporter&&(y=(new MiroImporter).importMiroJson(JSON.parse(y)))}catch(da){console.log("Miro import error:",da)}this.pasteXml(y,m,C,d);try{mxEvent.consume(d)}catch(da){}}else if(!g){var aa=this.editor.graph;aa.lastPasteXml=null;aa.pasteCounter=0}}catch(da){this.handleError(da)}}}f.innerHTML="&nbsp;"};EditorUi.prototype.addFileDropHandler=function(d){if(Graph.fileSupport)for(var f=null,g=