From faca1aeeb98f1da4637a464ba808c14fe2fdaa1a Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 24 Mar 2009 13:26:57 +0000 Subject: [PATCH] Support for password structures without a specified shell or a NULL/empty shell. This commit was SVN r20853. --- orte/mca/plm/rsh/plm_rsh_module.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/orte/mca/plm/rsh/plm_rsh_module.c b/orte/mca/plm/rsh/plm_rsh_module.c index a982a1adad..ef24f2eaeb 100644 --- a/orte/mca/plm/rsh/plm_rsh_module.c +++ b/orte/mca/plm/rsh/plm_rsh_module.c @@ -1486,7 +1486,17 @@ static orte_plm_rsh_shell_t find_shell(char *shell) int i = 0; char *sh_name = NULL; + if( (NULL == shell) || (strlen(shell) == 1) ) { + /* Malformed shell */ + return ORTE_PLM_RSH_SHELL_UNKNOWN; + } + sh_name = rindex(shell, '/'); + if( NULL == sh_name ) { + /* Malformed shell */ + return ORTE_PLM_RSH_SHELL_UNKNOWN; + } + /* skip the '/' */ ++sh_name; for (i = 0; i < (int)(sizeof (orte_plm_rsh_shell_name) /