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+xa),new mxPoint(B,ha+xa-v),new mxPoint(B,ha)]):(v=v?Math.max(0,Math.min(.5*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,ha+xa),new mxPoint(B,ha+xa),new mxPoint(B+v,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("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(c,l,x,p){var v="0"!=
mxUtils.getValue(l.style,"fixedSize","0"),A=v?Y.prototype.fixedSize:Y.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;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(.5*K,A)):K*Math.max(0,Math.min(1,A)),ha=[new mxPoint(B+v,ha),new mxPoint(B+K-v,ha),new mxPoint(B+K,ha+xa),new mxPoint(B,ha+xa),new mxPoint(B+
v,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,ha),new mxPoint(B+K,ha),new mxPoint(B+K-v,ha+xa),new mxPoint(B+v,ha+xa),new mxPoint(B,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(B+K,ha),new mxPoint(B+K,ha+xa),new mxPoint(B,ha+xa-v),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(B+
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,