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:
P(O)}),U=y.pageId||(null!=this.pages?y.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var X=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=U){var O=W.getGlobalVariable;W=this.createTemporaryGraph(W.getStylesheet());for(var S,Y=0;Y<this.pages.length;Y++)if(this.pages[Y].getId()==U){S=this.updatePageRoot(this.pages[Y]);break}null==S&&(S=this.currentPage);W.getGlobalVariable=function(ea){return"page"==ea?S.getName():"pagenumber"==
ea?1:O.apply(this,arguments)};document.body.appendChild(W.container);W.model.setRoot(S.root)}if(null!=y.layerIds){var da=W.model,ha=da.getChildCells(da.getRoot()),Z={};for(Y=0;Y<y.layerIds.length;Y++)Z[y.layerIds[Y]]=!0;for(Y=0;Y<ha.length;Y++)da.setVisible(ha[Y],Z[ha[Y].id]||!1)}this.editor.exportToCanvas(mxUtils.bind(this,function(ea){V(ea.toDataURL("image/png"))}),y.width,null,y.background,mxUtils.bind(this,function(){V(null)}),null,null,y.scale,y.transparent,y.shadow,null,W,y.border,null,y.grid,