From 6851da7c1df535e4c6d6397e3cf89d677babebfe Mon Sep 17 00:00:00 2001 From: mchinnathamb Date: Fri, 16 Feb 2018 01:37:10 -0800 Subject: [PATCH] 8189985: Improve tabular data portability Reviewed-by: dfuchs, robm --- .../javax/management/openmbean/TabularDataSupport.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/share/classes/javax/management/openmbean/TabularDataSupport.java b/src/share/classes/javax/management/openmbean/TabularDataSupport.java index 5740c79e6..4dcf214ff 100644 --- a/src/share/classes/javax/management/openmbean/TabularDataSupport.java +++ b/src/share/classes/javax/management/openmbean/TabularDataSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; +import sun.misc.SharedSecrets; // jmx import // @@ -911,6 +912,8 @@ public class TabularDataSupport throws IOException, ClassNotFoundException { in.defaultReadObject(); List tmpNames = tabularType.getIndexNames(); - indexNamesArray = tmpNames.toArray(new String[tmpNames.size()]); + int size = tmpNames.size(); + SharedSecrets.getJavaOISAccess().checkArray(in, String[].class, size); + indexNamesArray = tmpNames.toArray(new String[size]); } } -- GitLab