Skip to content

Commit b62f1da

Browse files
committed
Protect against constructor modification, #84
1 parent fb427cd commit b62f1da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/validate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O
207207
}
208208

209209
for(var i in objTypeDef){
210-
if(objTypeDef.hasOwnProperty(i) && i != '__proto__'){
210+
if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){
211211
var value = instance[i];
212212
// skip _not_ specified properties
213213
if (value === undefined && options.existingOnly) continue;

0 commit comments

Comments
 (0)