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.addShortcut=function(a,c){if(null!=c.shortcut){a=a.firstChild.nextSibling.nextSibling;var f=document.createElement("span");f.style.color="gray";mxUtils.write(f,c.shortcut);a.appendChild(f)}};Menus.prototype.addMenuItems=function(a,c,f,e,g){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(f):this.addMenuItem(a,c[d],f,e,null!=g?g[d]:null)};