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