Skip to content

Commit

Permalink
fix: do not let setProperty change the prototype (protobufjs#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored May 20, 2022
1 parent d9934af commit 3357ef7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ util.decorateEnum = function decorateEnum(object) {
util.setProperty = function setProperty(dst, path, value) {
function setProp(dst, path, value) {
var part = path.shift();
if (part === "__proto__") {
return dst;
}
if (path.length > 0) {
dst[part] = setProp(dst[part] || {}, path, value);
} else {
Expand Down

0 comments on commit 3357ef7

Please sign in to comment.