Protect against NULL when looking for an MCA param in an environment
This commit was SVN r23151.
Этот коммит содержится в:
родитель
7e6985edbf
Коммит
cc8ebe7dd5
@ -2201,6 +2201,10 @@ int mca_base_param_find_int(const mca_base_component_t *component,
|
|||||||
int len, i;
|
int len, i;
|
||||||
int rc=OPAL_ERR_NOT_FOUND;
|
int rc=OPAL_ERR_NOT_FOUND;
|
||||||
|
|
||||||
|
if (NULL == env) {
|
||||||
|
return OPAL_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
asprintf(&tmp, "%s%s_%s_%s", mca_prefix, component->mca_type_name,
|
asprintf(&tmp, "%s%s_%s_%s", mca_prefix, component->mca_type_name,
|
||||||
component->mca_component_name, param_name);
|
component->mca_component_name, param_name);
|
||||||
len = strlen(tmp);
|
len = strlen(tmp);
|
||||||
@ -2226,6 +2230,10 @@ int mca_base_param_find_int_name(const char *type,
|
|||||||
int len, i;
|
int len, i;
|
||||||
int rc=OPAL_ERR_NOT_FOUND;
|
int rc=OPAL_ERR_NOT_FOUND;
|
||||||
|
|
||||||
|
if (NULL == env) {
|
||||||
|
return OPAL_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
asprintf(&tmp, "%s%s_%s", mca_prefix, type, param_name);
|
asprintf(&tmp, "%s%s_%s", mca_prefix, type, param_name);
|
||||||
len = strlen(tmp);
|
len = strlen(tmp);
|
||||||
for (i=0; NULL != env[i]; i++) {
|
for (i=0; NULL != env[i]; i++) {
|
||||||
@ -2250,6 +2258,10 @@ int mca_base_param_find_string(const mca_base_component_t *component,
|
|||||||
int len, i;
|
int len, i;
|
||||||
int rc=OPAL_ERR_NOT_FOUND;
|
int rc=OPAL_ERR_NOT_FOUND;
|
||||||
|
|
||||||
|
if (NULL == env) {
|
||||||
|
return OPAL_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
asprintf(&tmp, "%s%s_%s_%s", mca_prefix, component->mca_type_name,
|
asprintf(&tmp, "%s%s_%s_%s", mca_prefix, component->mca_type_name,
|
||||||
component->mca_component_name, param_name);
|
component->mca_component_name, param_name);
|
||||||
len = strlen(tmp);
|
len = strlen(tmp);
|
||||||
@ -2275,6 +2287,10 @@ int mca_base_param_find_string_name(const char *type,
|
|||||||
int len, i;
|
int len, i;
|
||||||
int rc=OPAL_ERR_NOT_FOUND;
|
int rc=OPAL_ERR_NOT_FOUND;
|
||||||
|
|
||||||
|
if (NULL == env) {
|
||||||
|
return OPAL_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
asprintf(&tmp, "%s%s_%s", mca_prefix, type, param_name);
|
asprintf(&tmp, "%s%s_%s", mca_prefix, type, param_name);
|
||||||
len = strlen(tmp);
|
len = strlen(tmp);
|
||||||
for (i=0; NULL != env[i]; i++) {
|
for (i=0; NULL != env[i]; i++) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user