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:
EditorUi.prototype.resetScrollbars=function(){var a=this.editor.graph;if(!this.editor.extendCanvas)a.container.scrollTop=0,a.container.scrollLeft=0,mxUtils.hasScrollbars(a.container)||a.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(a.container))if(a.pageVisible){var c=a.getPagePadding();a.container.scrollTop=Math.floor(c.y-this.editor.initialTopSpacing)-1;a.container.scrollLeft=Math.floor(Math.min(c.x,(a.container.scrollWidth-a.container.clientWidth)/2))-
1;c=a.getGraphBounds();0<c.width&&0<c.height&&(c.x>a.container.scrollLeft+.9*a.container.clientWidth&&(a.container.scrollLeft=Math.min(c.x+c.width-a.container.clientWidth,c.x-10)),c.y>a.container.scrollTop+.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(c.y+c.height-a.container.clientHeight,c.y-10)))}else{c=a.getGraphBounds();var f=Math.max(c.width,a.scrollTileSize.width*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,c.y-Math.max(20,(a.container.clientHeight-Math.max(c.height,
a.scrollTileSize.height*a.view.scale))/4)));a.container.scrollLeft=Math.floor(Math.max(0,c.x-Math.max(0,(a.container.clientWidth-f)/2)))}else{c=mxRectangle.fromRectangle(a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds());f=a.view.translate;var e=a.view.scale;c.x=c.x/e-f.x;c.y=c.y/e-f.y;c.width/=e;c.height/=e;a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-c.width)/2)-c.x+2),Math.floor((a.pageVisible?0:Math.max(0,(a.container.clientHeight-c.height)/4))-c.y+1))}};