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:
EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),f=this.editor.undoManager,e=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});f.addListener(mxEvent.ADD,e);f.addListener(mxEvent.UNDO,e);f.addListener(mxEvent.REDO,e);f.addListener(mxEvent.CLEAR,e);var g=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){g.apply(this,arguments);e()};var d=this.editor.graph.cellEditor.stopEditing;
this.editor.graph.cellEditor.stopEditing=function(k,n){d.apply(this,arguments);e()};e()};