Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272608

java_lang_System::allow_security_manager() doesn't set its initialization flag

XMLWordPrintable

    • b09
    • 17
    • b15

        javaClasses.cpp:

        bool java_lang_System::allow_security_manager() {
          static int initialized = false;
          static bool allowed = true; // default
          if (!initialized) {
            oop base = vmClasses::System_klass()->static_field_base_raw();
            int never = base->int_field(_static_never_offset);
            allowed = (base->int_field(_static_allow_security_offset) != never);
          }
          return allowed;
        }

        We never set `initialized` to true, so every call to allow_security_manager() re-reads the System class field.

              msaavedrasil Matias Saavedra Silva (Inactive)
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: