Language: JavaScript
Label: vulnerable
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:
else{var y=c.getFileData(!0,null,null,null,null,!0),L=z.getGraphBounds(),N=Math.floor(L.width*m/z.view.scale),K=Math.floor(L.height*m/z.view.scale);if(y.length<=MAX_REQUEST_SIZE&&N*K<MAX_AREA)if(c.hideDialog(),"png"!=g&&"jpg"!=g&&"jpeg"!=g||!c.isExportToCanvas()){var q={globalVars:z.getExportVariables()};x&&(q.grid={size:z.gridSize,steps:z.view.gridSteps,color:z.view.gridColor});c.saveRequest(e,g,function(E,A){return new mxXmlRequest(EXPORT_URL,"format="+g+"&base64="+(A||"0")+(null!=E?"&filename="+
encodeURIComponent(E):"")+"&extras="+encodeURIComponent(JSON.stringify(q))+(0<v?"&dpi="+v:"")+"&bg="+(null!=k?k:"none")+"&w="+N+"&h="+K+"&border="+p+"&xml="+encodeURIComponent(y))})}else"png"==g?c.exportImage(m,null==k||"none"==k,!0,!1,!1,p,!0,!1,null,x,v):c.exportImage(m,!1,!0,!1,!1,p,!0,!1,"jpeg",x);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,e="";if(null!=this.pages)for(var g=