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:
Graph.prototype.fitWindow=function(a,c){c=null!=c?c:10;var f=this.container.clientWidth-c,e=this.container.clientHeight-c,g=Math.floor(20*Math.min(f/a.width,e/a.height))/20;this.zoomTo(g);if(mxUtils.hasScrollbars(this.container)){var d=this.view.translate;this.container.scrollTop=(a.y+d.y)*g-Math.max((e-a.height*g)/2+c/2,0);this.container.scrollLeft=(a.x+d.x)*g-Math.max((f-a.width*g)/2+c/2,0)}};