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

ClassLoader::initialize_module_loader_map() reads invalid memory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 9
    • 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.

            ccheung Calvin Cheung
            mgronlun Markus Grönlund
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: