8006103: [parfait] Possible null pointer dereference at hotspot/src/os/linux/vm/os_linux.cpp; os_windows.cpp; os_solaris.cpp; os_bsd.cpp

Reviewed-by: zgu, iklam
This commit is contained in:
Calvin Cheung 2013-04-03 16:43:09 -07:00
parent 5f93d0e84c
commit 33f6dd2215
4 changed files with 12 additions and 0 deletions

View File

@ -1214,6 +1214,9 @@ bool os::dll_build_name(char* buffer, size_t buflen,
} else if (strchr(pname, *os::path_separator()) != NULL) {
int n;
char** pelements = split_path(pname, &n);
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
// Really shouldn't be NULL, but check can't hurt
if (pelements[i] == NULL || strlen(pelements[i]) == 0) {

View File

@ -1647,6 +1647,9 @@ bool os::dll_build_name(char* buffer, size_t buflen,
} else if (strchr(pname, *os::path_separator()) != NULL) {
int n;
char** pelements = split_path(pname, &n);
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
// Really shouldn't be NULL, but check can't hurt
if (pelements[i] == NULL || strlen(pelements[i]) == 0) {

View File

@ -1903,6 +1903,9 @@ bool os::dll_build_name(char* buffer, size_t buflen,
} else if (strchr(pname, *os::path_separator()) != NULL) {
int n;
char** pelements = split_path(pname, &n);
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
// really shouldn't be NULL but what the heck, check can't hurt
if (pelements[i] == NULL || strlen(pelements[i]) == 0) {

View File

@ -1177,6 +1177,9 @@ bool os::dll_build_name(char *buffer, size_t buflen,
} else if (strchr(pname, *os::path_separator()) != NULL) {
int n;
char** pelements = split_path(pname, &n);
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
char* path = pelements[i];
// Really shouldn't be NULL, but check can't hurt