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:
DiagramFormatPanel.prototype.addGridOption=function(a){function c(u){var m=f.isFloatUnit()?parseFloat(d.value):parseInt(d.value);m=f.fromUnit(Math.max(f.inUnit(1),isNaN(m)?f.inUnit(10):m));m!=g.getGridSize()&&(mxGraph.prototype.gridSize=m,g.setGridSize(m));d.value=f.inUnit(m)+" "+f.getUnit();mxEvent.consume(u)}var f=this,e=this.editorUi,g=e.editor.graph,d=document.createElement("input");d.style.position="absolute";d.style.textAlign="right";d.style.width="48px";d.style.marginTop="-2px";d.style.height=