changeset 9613:17773cf4ad39 jdk7u191-b00

8205491: adjust reflective access checks Reviewed-by: alanb, mchung, igerasim, rhalade, ahgross
author igerasim
date Tue, 26 Jun 2018 23:58:35 +0100
parents 82ff08688969
children af02183fceae
files src/share/classes/java/io/ObjectStreamClass.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/io/ObjectStreamClass.java	Thu Jun 28 02:54:57 2018 +0100
+++ b/src/share/classes/java/io/ObjectStreamClass.java	Tue Jun 26 23:58:35 2018 +0100
@@ -1537,11 +1537,11 @@
             }
             return false;
         } else {
-            // accessible if the parent is public and any constructor
-            // is protected or public
-            if ((superCl.getModifiers() & Modifier.PUBLIC) == 0) {
+            // sanity check to ensure the parent is protected or public
+            if ((superCl.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) == 0) {
                 return false;
             }
+            // accessible if any constructor is protected or public
             for (Constructor<?> ctor : superCl.getDeclaredConstructors()) {
                 if ((ctor.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) != 0) {
                     return true;