Language: JavaScript
Label: safe
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
EditorUi.prototype.patchPages=function(b,e,f,c,k){var m={},u=[],v={},E={},D={},A={};if(null!=c&&null!=c[EditorUi.DIFF_UPDATE])for(var L in c[EditorUi.DIFF_UPDATE])m[L]=c[EditorUi.DIFF_UPDATE][L];if(null!=e[EditorUi.DIFF_REMOVE])for(c=0;c<e[EditorUi.DIFF_REMOVE].length;c++)E[e[EditorUi.DIFF_REMOVE][c]]=!0;if(null!=e[EditorUi.DIFF_INSERT])for(c=0;c<e[EditorUi.DIFF_INSERT].length;c++)v[e[EditorUi.DIFF_INSERT][c].previous]=e[EditorUi.DIFF_INSERT][c];if(null!=e[EditorUi.DIFF_UPDATE])for(L in e[EditorUi.DIFF_UPDATE])c=
e[EditorUi.DIFF_UPDATE][L],null!=c.previous&&(A[c.previous]=L);if(null!=b){var H="";for(c=0;c<b.length;c++){var d=b[c].getId();D[d]=b[c];null!=A[H]||E[d]||null!=e[EditorUi.DIFF_UPDATE]&&null!=e[EditorUi.DIFF_UPDATE][d]&&null!=e[EditorUi.DIFF_UPDATE][d].previous||(A[H]=d);H=d}}var g={},n=mxUtils.bind(this,function(t){var x=null!=t?t.getId():"";if(null!=t&&!g[x]){g[x]=!0;u.push(t);var B=null!=e[EditorUi.DIFF_UPDATE]?e[EditorUi.DIFF_UPDATE][x]:null;null!=B&&(this.updatePageRoot(t),null!=B.name&&t.setName(B.name),
null!=B.view&&this.patchViewState(t,B.view),null!=B.cells&&this.patchPage(t,B.cells,m[t.getId()],k),!f||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=A[x];null!=t&&(delete A[x],n(D[t]));t=v[x];null!=t&&(delete v[x],q(t))}),q=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;t=new DiagramPage(t);this.updatePageRoot(t);var x=D[t.getId()];null==x?n(t):(this.patchPage(x,this.diffPages([x],[t]),m[x.getId()],k),f&&(x.needsUpdate=!0))});n();for(L in A)n(D[A[L]]),delete A[L];for(L in v)q(v[L]),
delete v[L];return u};EditorUi.prototype.patchViewState=function(b,e){if(null!=b.viewState&&null!=e){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var f in e)try{this.patchViewStateProperty(b,e,f)}catch(c){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,e,f){b.viewState[f]=JSON.parse(e[f])};