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:
Sidebar.prototype.createItem=function(a,c,f,e,g,d,k,n){n=null!=n?n:!0;var u=document.createElement("a");u.className="geItem";u.style.overflow="hidden";var m=2*this.thumbBorder;u.style.width=this.thumbWidth+m+"px";u.style.height=this.thumbHeight+m+"px";u.style.padding=this.thumbPadding+"px";mxEvent.addListener(u,"click",function(x){mxEvent.consume(x)});m=a;a=this.graph.cloneCells(a);this.editorUi.insertHandler(m,null,this.graph.model,this.editorUi.editor.graph.defaultVertexStyle,this.editorUi.editor.graph.defaultEdgeStyle,
!0,!0);this.createThumb(m,this.thumbWidth,this.thumbHeight,u,c,f,e,g,d);var r=new mxRectangle(0,0,g,d);1<a.length||a[0].vertex?(e=this.createDragSource(u,this.createDropHandler(a,!0,k,r),this.createDragPreview(g,d),a,r),this.addClickHandler(u,e,a),e.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):null!=a[0]&&a[0].edge&&(e=this.createDragSource(u,this.createDropHandler(a,!1,k,r),this.createDragPreview(g,d),a,r),this.addClickHandler(u,e,a));
!mxClient.IS_IOS&&n&&mxEvent.addGestureListeners(u,null,mxUtils.bind(this,function(x){mxEvent.isMouseEvent(x)&&this.showTooltip(u,a,r.width,r.height,c,f)}));return u};