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:
Graph.prototype.replacePlaceholders=function(a,b,f,e){e=[];if(null!=b){for(var g=0;match=this.placeholderPattern.exec(b);){var d=match[0];if(2<d.length&&"%label%"!=d&&"%tooltip%"!=d){var k=null;if(match.index>g&&"%"==b.charAt(match.index-1))k=d.substring(1);else{var n=d.substring(1,d.length-1);if("id"==n)k=a.id;else if(0>n.indexOf("{"))for(var u=a;null==k&&null!=u;)null!=u.value&&"object"==typeof u.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(k=u.getAttribute(n+"_"+Graph.diagramLanguage)),
null==k&&(k=u.hasAttribute(n)?null!=u.getAttribute(n)?u.getAttribute(n):"":null)),u=this.model.getParent(u);null==k&&(k=this.getGlobalVariable(n));null==k&&null!=f&&(k=f[n])}e.push(b.substring(g,match.index)+(null!=k?k:d));g=match.index+d.length}}e.push(b.substring(g))}return e.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0<a.length){for(var b=[],f=0;f<a.length;f++){var e=this.model.getCell(a[f].id);null!=e&&b.push(e)}this.setSelectionCells(b)}else this.clearSelection()};