Skip to content

Commit

Permalink
Protect against constructor modification, #84
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Nov 2, 2021
1 parent fb427cd commit b62f1da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
}

for(var i in objTypeDef){
if(objTypeDef.hasOwnProperty(i) && i != '__proto__'){
if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){
var value = instance[i];
// skip _not_ specified properties
if (value === undefined && options.existingOnly) continue;
Expand Down

0 comments on commit b62f1da

Please sign in to comment.