changeset 4808:be131aa5a529

8011896: Add check for invalid offset for new AccessControlContext isAuthorized field Reviewed-by: acorn
author mullan
date Mon, 22 Apr 2013 08:33:12 -0400
parents b295e132102d
children 3463b5b373f7
files src/share/vm/classfile/javaClasses.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/javaClasses.cpp	Fri Apr 05 10:18:36 2013 -0400
+++ b/src/share/vm/classfile/javaClasses.cpp	Mon Apr 22 08:33:12 2013 -0400
@@ -2819,8 +2819,10 @@
   result->obj_field_put(_context_offset, context());
   result->obj_field_put(_privilegedContext_offset, privileged_context());
   result->bool_field_put(_isPrivileged_offset, isPrivileged);
-  // whitelist AccessControlContexts created by the JVM.
-  result->bool_field_put(_isAuthorized_offset, true);
+  // whitelist AccessControlContexts created by the JVM if present
+  if (_isAuthorized_offset != -1) {
+    result->bool_field_put(_isAuthorized_offset, true);
+  }
   return result;
 }