Skip to content

Commit 70639ec

Browse files
authored
Merge pull request #67 from RooVetGit/alert-autofix-2
Fix code scanning alert no. 2: Prototype-polluting function
2 parents 20c7c57 + b2f0aae commit 70639ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webview-ui/src/components/history/HistoryView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,13 @@ export const highlight = (
462462
let i: number
463463

464464
for (i = 0; i < pathValue.length - 1; i++) {
465+
if (pathValue[i] === "__proto__" || pathValue[i] === "constructor") return
465466
obj = obj[pathValue[i]] as Record<string, any>
466467
}
467468

468-
obj[pathValue[i]] = value
469+
if (pathValue[i] !== "__proto__" && pathValue[i] !== "constructor") {
470+
obj[pathValue[i]] = value
471+
}
469472
}
470473

471474
// Function to merge overlapping regions

0 commit comments

Comments
 (0)