Language: JavaScript
Label: safe
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,b){b=null!=b?b:10;var f=this.container.clientWidth-b,e=this.container.clientHeight-b,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+b/2,0);this.container.scrollLeft=(a.x+d.x)*g-Math.max((f-a.width*g)/2+b/2,0)}};