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().
======================================================================
- duplicates
-
JDK-4070266 SetLibraryPath() deals with LD_LIBRARY_PATH incorrectly
- Closed