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:
if("xml"==g)c.hideDialog(),c.saveData(e,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==g)c.hideDialog(),c.saveData(e,"svg",mxUtils.getXml(z.getSvg(k,m,p)),"image/svg+xml");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"))}});