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:
arguments));this.originalClose.apply(this.canvas,arguments)};X.prototype.quadTo=function(c,l,x,p){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=p};X.prototype.curveTo=function(c,l,x,p,v,A){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=v;this.lastY=A};X.prototype.arcTo=function(c,l,x,p,v,A,B){this.originalArcTo.apply(this.canvas,arguments);this.lastX=A;this.lastY=B};X.prototype.lineTo=function(c,l){if(null!=this.lastX&&null!=this.lastY){var x=function(na){return"number"===
typeof na?na?0>na?-1:1:na===na?0:NaN:NaN},p=Math.abs(c-this.lastX),v=Math.abs(l-this.lastY),A=Math.sqrt(p*p+v*v);if(2>A){this.originalLineTo.apply(this.canvas,arguments);this.lastX=c;this.lastY=l;return}var B=Math.round(A/10),ha=this.defaultVariation;5>B&&(B=5,ha/=3);var K=x(c-this.lastX)*p/B;x=x(l-this.lastY)*v/B;p/=A;v/=A;for(A=0;A<B;A++){var xa=(Math.random()-.5)*ha;this.originalLineTo.call(this.canvas,K*A+this.lastX-xa*v,x*A+this.lastY-xa*p)}this.originalLineTo.call(this.canvas,c,l)}else this.originalLineTo.apply(this.canvas,
arguments);this.lastX=c;this.lastY=l};X.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};mxShape.prototype.defaultJiggle=1.5;var gb=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(c){gb.apply(this,arguments);null==c.handJiggle&&(c.handJiggle=this.createHandJiggle(c))};