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:
J(Q)}),U=A.pageId||(null!=this.pages?A.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 Q=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(fa){return"page"==fa?S.getName():"pagenumber"==
fa?1:Q.apply(this,arguments)};document.body.appendChild(W.container);W.model.setRoot(S.root)}if(null!=A.layerIds){var ba=W.model,ea=ba.getChildCells(ba.getRoot()),Z={};for(Y=0;Y<A.layerIds.length;Y++)Z[A.layerIds[Y]]=!0;for(Y=0;Y<ea.length;Y++)ba.setVisible(ea[Y],Z[ea[Y].id]||!1)}this.editor.exportToCanvas(mxUtils.bind(this,function(fa){V(fa.toDataURL("image/png"))}),A.width,null,A.background,mxUtils.bind(this,function(){V(null)}),null,null,A.scale,A.transparent,A.shadow,null,W,A.border,null,A.grid,