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:
try{this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage()),0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{E.container.style.visibility="";E.model.endUpdate();E.cellRenderer.redraw=m;this.changeListenerEnabled=d;k||(n.history=D,n.indexOfNextAdd=t,n.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)g!=E.mathEnabled?
(this.ui.editor.updateGraphComponents(),E.refresh()):(f!=E.foldingEnabled?E.view.revalidate():E.view.validate(),E.sizeDidChange());null!=this.sync&&this.isRealtime()&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.updateTabContainer();this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",k)}return b};