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:
ChangePageSetup.prototype.execute=function(){var a=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var b=a.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=b}if(!this.ignoreImage){this.image=this.previousImage;b=a.backgroundImage;var f=this.previousImage;null!=f&&null!=f.src&&"data:page/id,"==f.src.substring(0,13)&&(f=this.ui.createImageForPageLink(f.src,this.ui.currentPage));this.ui.setBackgroundImage(f);this.previousImage=b}null!=this.previousFormat&&
(this.format=this.previousFormat,b=a.pageFormat,this.previousFormat.width!=b.width||this.previousFormat.height!=b.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=b);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled);null!=this.previousPageScale&&(a=this.ui.editor.graph.pageScale,this.previousPageScale!=a&&(this.ui.setPageScale(this.previousPageScale),
this.previousPageScale=a))};(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat","previousPageScale"]);a.afterDecode=function(b,f,e){e.previousColor=e.color;e.previousImage=e.image;e.previousFormat=e.format;e.previousPageScale=e.pageScale;null!=e.foldingEnabled&&(e.foldingEnabled=!e.foldingEnabled);return e};mxCodecRegistry.register(a)})();