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.setDatabaseItem=function(c,e,g,k,m){this.openDatabase(mxUtils.bind(this,function(p){try{m=m||"objects";Array.isArray(m)||(m=[m],c=[c],e=[e]);var v=p.transaction(m,"readwrite");v.oncomplete=g;v.onerror=k;for(p=0;p<m.length;p++)v.objectStore(m[p]).put(null!=c&&null!=c[p]?{key:c[p],data:e[p]}:e[p])}catch(x){null!=k&&k(x)}}),k)};EditorUi.prototype.removeDatabaseItem=function(c,e,g,k){this.openDatabase(mxUtils.bind(this,function(m){k=k||"objects";Array.isArray(k)||(k=[k],c=[c]);m=m.transaction(k,
"readwrite");m.oncomplete=e;m.onerror=g;for(var p=0;p<k.length;p++)m.objectStore(k[p]).delete(c[p])}),g)};EditorUi.prototype.getDatabaseItem=function(c,e,g,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var p=m.transaction([k],"readonly").objectStore(k).get(c);p.onsuccess=function(){e(p.result)};p.onerror=g}catch(v){null!=g&&g(v)}}),g)};EditorUi.prototype.getDatabaseItems=function(c,e,g){this.openDatabase(mxUtils.bind(this,function(k){try{g=g||"objects";var m=k.transaction([g],