Skip to content

Commit

Permalink
Fix minor regression wrt patch for #1855
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 19, 2017
1 parent 29bdca2 commit 9787983
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,6 @@ protected void _validateSubType(DeserializationContext ctxt, JavaType type,
BeanDescription beanDesc)
throws JsonMappingException
{
SubTypeValidator.instance().validateSubType(ctxt, type);
SubTypeValidator.instance().validateSubType(ctxt, type, beanDesc);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
Expand Down Expand Up @@ -64,7 +65,8 @@ protected SubTypeValidator() { }

public static SubTypeValidator instance() { return instance; }

public void validateSubType(DeserializationContext ctxt, JavaType type) throws JsonMappingException
public void validateSubType(DeserializationContext ctxt, JavaType type,
BeanDescription beanDesc) throws JsonMappingException
{
// There are certain nasty classes that could cause problems, mostly
// via default typing -- catch them here.
Expand Down Expand Up @@ -92,7 +94,7 @@ public void validateSubType(DeserializationContext ctxt, JavaType type) throws J
return;
} while (false);

throw JsonMappingException.from(ctxt,
String.format("Illegal type (%s) to deserialize: prevented for security reasons", full));
ctxt.reportBadTypeDefinition(beanDesc,
"Illegal type (%s) to deserialize: prevented for security reasons", full);
}
}

0 comments on commit 9787983

Please sign in to comment.