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:
Toolbar.prototype.addButton=function(a,c,f,e){a=this.createButton(a);e=null!=e?e:this.container;this.initElement(a,c);this.addClickHandler(a,f);e.appendChild(a);return a};Toolbar.prototype.initElement=function(a,c){null!=c&&a.setAttribute("title",c);this.addEnabledState(a)};Toolbar.prototype.addEnabledState=function(a){var c=a.className;a.setEnabled=function(f){a.enabled=f;a.className=f?c:c+" mxDisabled"};a.setEnabled(!0)};