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:
EditorUi.prototype.createPageMenuTab=function(b,e){b=this.createControlTab(3,'<div class="geSprite geSprite-dots"></div>',b);b.setAttribute("title",mxResources.get("pages"));b.style.position="absolute";b.style.marginLeft="0px";b.style.top="0px";b.style.left="1px";var k=b.getElementsByTagName("div")[0];k.style.display="inline-block";k.style.marginTop="5px";k.style.width="21px";k.style.height="21px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(n){this.editor.graph.popupMenuHandler.hideMenu();
var D=new mxPopupMenu(mxUtils.bind(this,function(d,f){var g=mxUtils.bind(this,function(){for(var F=0;F<this.pages.length;F++)mxUtils.bind(this,function(C){var H=d.addItem(this.pages[C].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[C])}),f),G=this.pages[C].getId();H.setAttribute("title",this.pages[C].getName()+" ("+(C+1)+"/"+this.pages.length+")"+(null!=G?" ["+G+"]":""));this.pages[C]==this.currentPage&&d.addCheckmark(H,Editor.checkmarkImage)})(F)}),m=mxUtils.bind(this,function(){d.addItem(mxResources.get("insertPage"),
null,mxUtils.bind(this,function(){this.insertPage()}),f)});e||g();if(this.editor.graph.isEnabled()){e||(d.addSeparator(f),m());var q=this.currentPage;if(null!=q){d.addSeparator(f);var y=q.getName();d.addItem(mxResources.get("removeIt",[y]),null,mxUtils.bind(this,function(){this.removePage(q)}),f);d.addItem(mxResources.get("renameIt",[y]),null,mxUtils.bind(this,function(){this.renamePage(q,q.getName())}),f);e||d.addSeparator(f);d.addItem(mxResources.get("duplicateIt",[y]),null,mxUtils.bind(this,function(){this.duplicatePage(q,
mxResources.get("copyOf",[q.getName()]))}),f)}}e&&(d.addSeparator(f),m(),d.addSeparator(f),g())}));D.div.className+=" geMenubarMenu";D.smartSeparators=!0;D.showDisabled=!0;D.autoExpand=!0;D.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(D,arguments);D.destroy()});var t=mxEvent.getClientX(n),E=mxEvent.getClientY(n);D.popup(t,E,null,n);this.setCurrentMenu(D);mxEvent.consume(n)}));return b};