提交 dba6a3ec 编写于 作者: D dmocek

8000638: Improve deserialization

Reviewed-by: smarks, hawtin, mchung
上级 9f72d15a
......@@ -1151,7 +1151,14 @@ public class ObjectStreamClass implements Serializable {
end = end.getSuperclass();
}
HashSet<String> oscNames = new HashSet<>(3);
for (ObjectStreamClass d = this; d != null; d = d.superDesc) {
if (oscNames.contains(d.name)) {
throw new InvalidClassException("Circular reference.");
} else {
oscNames.add(d.name);
}
// search up inheritance hierarchy for class with matching name
String searchName = (d.cl != null) ? d.cl.getName() : d.name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册