Language: JavaScript
Label: vulnerable
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 l={},u=[],x={},E={},D={},A={};if(null!=c&&null!=c[EditorUi.DIFF_UPDATE])for(var K in c[EditorUi.DIFF_UPDATE])l[K]=c[EditorUi.DIFF_UPDATE][K];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++)x[e[EditorUi.DIFF_INSERT][c].previous]=e[EditorUi.DIFF_INSERT][c];if(null!=e[EditorUi.DIFF_UPDATE])for(K in e[EditorUi.DIFF_UPDATE])c=
e[EditorUi.DIFF_UPDATE][K],null!=c.previous&&(A[c.previous]=K);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 v=null!=t?t.getId():"";if(null!=t&&!g[v]){g[v]=!0;u.push(t);var B=null!=e[EditorUi.DIFF_UPDATE]?e[EditorUi.DIFF_UPDATE][v]: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,l[t.getId()],k),!f||null==B.cells&&null==B.view||(t.needsUpdate=!0))}t=A[v];null!=t&&(delete A[v],n(D[t]));t=x[v];null!=t&&(delete x[v],q(t))}),q=mxUtils.bind(this,function(t){t=mxUtils.parseXml(t.data).documentElement;t=new DiagramPage(t);this.updatePageRoot(t);var v=D[t.getId()];null==v?n(t):(this.patchPage(v,this.diffPages([v],[t]),l[v.getId()],k),f&&(v.needsUpdate=!0))});n();for(K in A)n(D[A[K]]),delete A[K];for(K in x)q(x[K]),
delete x[K];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])};