Skip to content

Commit fee8eb4

Browse files
committed
Fix #2060
1 parent 150a49f commit fee8eb4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

release-notes/CREDITS-2.x

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,4 +797,8 @@ Chetan Narsude (243826@github)
797797
* Reported #2038: JDK Serializing and using Deserialized `ObjectMapper` loses linkage
798798
back from `JsonParser.getCodec()`
799799
(2.9.6)
800-
800+
801+
Petar Tahchiev (ptahchiev@github)
802+
* Reported #2060: `UnwrappingBeanPropertyWriter` incorrectly assumes the found
803+
serializer is of type `UnwrappingBeanSerializer`
804+
(2.9.6)

release-notes/VERSION-2.x

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Project: jackson-databind
5252
(reported by Guixiong Wu)
5353
#2058: CVE-2018-12023: Block polymorphic deserialization of types from Oracle JDBC driver
5454
(reported by Guixiong Wu)
55+
#2060: `UnwrappingBeanPropertyWriter` incorrectly assumes the found serializer is
56+
of type `UnwrappingBeanSerializer`
57+
(reported by Petar T)
5558

5659
2.9.5 (26-Mar-2018)
5760

src/main/java/com/fasterxml/jackson/databind/ser/impl/UnwrappingBeanPropertyWriter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ public void assignSerializer(JsonSerializer<Object> ser)
136136
{
137137
if (ser != null) {
138138
NameTransformer t = _nameTransformer;
139-
if (ser.isUnwrappingSerializer()) {
139+
if (ser.isUnwrappingSerializer()
140+
// as per [databind#2060], need to also check this, in case someone writes
141+
// custom implementation that does not extend standard implementation:
142+
&& (ser instanceof UnwrappingBeanSerializer)) {
140143
t = NameTransformer.chainedTransformer(t, ((UnwrappingBeanSerializer) ser)._nameTransformer);
141144
}
142145
ser = ser.unwrappingSerializer(t);

0 commit comments

Comments
 (0)