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

jre bug -- SetLibraryPath() derefs nil pointer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.4
    • hotspot
    • None
    • sparc
    • solaris_2.5.1



      Name: diC59631 Date: 09/25/97


      I work for SGI, a JDK licensee.

      In javasrc/src/solaris/java/jre/jre_md.c, there
      is a check for a nil pointer, and then a dereference
      of that pointer, *only* when the pointer is nil:

          char *s = getenv("LD_LIBRARY_PATH"), *buf;

          /* Set library path */
          if (s == 0) {
              buf = JRE_Malloc(strlen(dir) + strlen(s) + 32);
              sprintf(buf, "LD_LIBRARY_PATH=%s:%s", dir, s);
          } else {
              buf = JRE_Malloc(strlen(dir) + 32);
              sprintf(buf, "LD_LIBRARY_PATH=%s", dir);
          }

      Negating the sense of the null pointer check fixes
      this. This code is in the short function
      SetLibraryPath().
      ======================================================================

            dconnellsunw David Connelly (Inactive)
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: