ClassLoader::initialize_module_loader_map() reads invalid memory

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: hotspot
    • None

      What is returned from JImageGetResource() is not a C "string" (as it is not null terminated). It uses the '\n' delimiter to sentinel individual module entry names.

      Treating this data as a C string (using for example strlen() and strchr()) is risky:

      int buflen = (int)strlen(char_buf);

      The use of strlen() here reads outside of the data returned from JImageGetResource() - in my case it even read into an unmapped page, causing a SIGSEGV.

            Assignee:
            Calvin Cheung (Inactive)
            Reporter:
            Markus Grönlund
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: