Skip to content

Commit 03a2513

Browse files
committed
dpm: Handle erroneous argument passing case
We do pass NULL as a value for modifier (although not when directive is NULL), which was causing compiler warnings on modern GCC. Handle the bozo case to prevent said warnings. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent ca99004 commit 03a2513

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/dpm/dpm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,9 @@ static int dpm_convert(opal_list_t *infos,
783783
/**** Get here if the specified option is not found in the
784784
**** current list - add it
785785
****/
786-
787-
if (NULL == directive) {
786+
if (NULL == directive && NULL == modifier) {
787+
return OMPI_ERR_BAD_PARAM;
788+
} else if (NULL == directive) {
788789
opal_asprintf(&ptr, ":%s", modifier);
789790
} else if (NULL == modifier) {
790791
ptr = strdup(directive);

0 commit comments

Comments
 (0)