Language: JavaScript
Label: vulnerable
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
Graph.prototype.fitDiagramToWindow=function(){var a=this.isSelectionEmpty()?mxRectangle.fromRectangle(this.getGraphBounds()):this.getBoundingBox(this.getSelectionCells()),b=this.view.translate,e=this.view.scale;a.x=a.x/e-b.x;a.y=a.y/e-b.y;a.width/=e;a.height/=e;null!=this.backgroundImage&&a.add(new mxRectangle(0,0,this.backgroundImage.width,this.backgroundImage.height));0==a.width||0==a.height?(this.zoomTo(1),ui.resetScrollbars()):(b=Editor.fitWindowBorders,null!=b&&(a.x-=b.x,a.y-=b.y,a.width+=b.width+
b.x,a.height+=b.height+b.y),this.fitWindow(a))};Graph.prototype.fitWindow=function(a,b){b=null!=b?b:10;var e=this.container.clientWidth-b,f=this.container.clientHeight-b;this.zoomTo(Math.floor(20*Math.min(e/a.width,f/a.height))/20);if(mxUtils.hasScrollbars(this.container)){var g=this.view.translate;this.container.scrollLeft=(a.x+g.x)*this.view.scale-Math.max((e-a.width*this.view.scale)/2+b/2,0);this.container.scrollTop=(a.y+g.y)*this.view.scale-Math.max((f-a.height*this.view.scale)/2+b/2,0)}};