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:
K,ha+v),new mxPoint(B+K,ha+xa-v),new mxPoint(B,ha+xa),new mxPoint(B,ha)]);xa=c.getCenterX();c=c.getCenterY();c=new mxPoint(xa,c);p&&(x.x<B||x.x>B+K?c.y=x.y:c.x=x.x);return mxUtils.getPerimeterPoint(ha,c,x)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(c,l,x,p){var v="0"!=mxUtils.getValue(l.style,"fixedSize","0"),A=v?U.prototype.fixedSize:U.prototype.size;null!=l&&(A=mxUtils.getValue(l.style,"size",A));v&&(A*=l.view.scale);var B=c.x,
ha=c.y,K=c.width,xa=c.height,na=c.getCenterX();c=c.getCenterY();l=null!=l?mxUtils.getValue(l.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;l==mxConstants.DIRECTION_EAST?(v=v?Math.max(0,Math.min(K,A)):K*Math.max(0,Math.min(1,A)),ha=[new mxPoint(B,ha),new mxPoint(B+K-v,ha),new mxPoint(B+K,c),new mxPoint(B+K-v,ha+xa),new mxPoint(B,ha+xa),new mxPoint(B+v,c),new mxPoint(B,ha)]):l==mxConstants.DIRECTION_WEST?(v=v?Math.max(0,Math.min(K,A)):K*Math.max(0,Math.min(1,
A)),ha=[new mxPoint(B+v,ha),new mxPoint(B+K,ha),new mxPoint(B+K-v,c),new mxPoint(B+K,ha+xa),new mxPoint(B+v,ha+xa),new mxPoint(B,c),new mxPoint(B+v,ha)]):l==mxConstants.DIRECTION_NORTH?(v=v?Math.max(0,Math.min(xa,A)):xa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(B,ha+v),new mxPoint(na,ha),new mxPoint(B+K,ha+v),new mxPoint(B+K,ha+xa),new mxPoint(na,ha+xa-v),new mxPoint(B,ha+xa),new mxPoint(B,ha+v)]):(v=v?Math.max(0,Math.min(xa,A)):xa*Math.max(0,Math.min(1,A)),ha=[new mxPoint(B,ha),new mxPoint(na,ha+
v),new mxPoint(B+K,ha),new mxPoint(B+K,ha+xa-v),new mxPoint(na,ha+xa),new mxPoint(B,ha+xa-v),new mxPoint(B,ha)]);na=new mxPoint(na,c);p&&(x.x<B||x.x>B+K?na.y=x.y:na.x=x.x);return mxUtils.getPerimeterPoint(ha,na,x)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(c,l,x,p){var v="0"!=mxUtils.getValue(l.style,"fixedSize","0"),A=v?I.prototype.fixedSize:I.prototype.size;null!=l&&(A=mxUtils.getValue(l.style,"size",A));v&&(A*=l.view.scale);var B=