Skip to content

Commit e01ba1e

Browse files
authored
Merge pull request #54 from intel/alert-autofix-3
Potential fix for code scanning alert no. 3: Prototype-polluting function
2 parents 7cd52c3 + 81dbc6d commit e01ba1e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gprofiler/frontend/src/utils/generalUtils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ function clone(target) {
5858
function _clone(b, a) {
5959
var nextBatch = [];
6060
for (var key in b) {
61+
if (key === '__proto__' || key === 'constructor') {
62+
continue; // Skip unsafe properties
63+
}
6164
if (typeof b[key] === 'object' && b[key] !== null) {
6265
if (b[key] instanceof Array) {
6366
a[key] = [];

0 commit comments

Comments
 (0)