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:
Menus.prototype.put=function(a,c){return this.menus[a]=c};Menus.prototype.get=function(a){return this.menus[a]};Menus.prototype.addSubmenu=function(a,c,f,e){var g=this.get(a);null!=g&&(g=g.isEnabled(),c.showDisabled||g)&&(f=c.addItem(e||mxResources.get(a),null,null,f,null,g),this.addMenu(a,c,f))};Menus.prototype.addMenu=function(a,c,f){var e=this.get(a);null!=e&&(c.showDisabled||e.isEnabled())&&this.get(a).execute(c,f)};