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.addItems=function(a,c,f){for(var e=[],g=0;g<a.length;g++){var d=a[g];"-"==d?e.push(this.addSeparator(c)):e.push(this.addItem("geSprite-"+d.toLowerCase(),d,c,f))}return e};Toolbar.prototype.addItem=function(a,c,f,e){var g=this.editorUi.actions.get(c),d=null;null!=g&&(c=g.label,null!=g.shortcut&&(c+=" ("+g.shortcut+")"),d=this.addButton(a,c,g.funct,f),e||"function"!==typeof d.setEnabled||(d.setEnabled(g.enabled),g.addListener("stateChanged",function(){d.setEnabled(g.enabled)})));return d};