Index: src/cmds/common_cmds.c =================================================================== --- src/cmds/common_cmds.c (revision 6553) +++ src/cmds/common_cmds.c (revision 6554) @@ -6,6 +6,7 @@ #include #include #include +#include "pbs_error_db.h" void strtolower( char *value) @@ -36,6 +37,10 @@ len_total = strlen(one_var); tmp_char = strchr(one_var, '='); + /* check to make sure we got an '=' */ + if(tmp_char == NULL) + return(PBSE_BAD_PARAMETER); + pos_eq = tmp_char - one_var; len_name = pos_eq; tmp_pos = pos_eq + 1; @@ -65,7 +70,7 @@ strncpy(*value, one_var + tmp_pos, len_value); } - return(len_name); + return(PBSE_NONE); } /* END parse_env_line() */ @@ -80,10 +85,18 @@ int var_num = 0; char *name = NULL; char *value = NULL; + int rc = PBSE_NONE; while (envp[var_num] != NULL) { - parse_env_line(mm, envp[var_num], &name, &value); + rc = parse_env_line(mm, envp[var_num], &name, &value); + if (rc != PBSE_NONE) + { + fprintf(stderr, "Malformed environment variable %s. Will not add to job environment\n", envp[var_num]); + ; + exit(1); + } + if (value != NULL) { /* strtolower(name); */ Index: CHANGELOG =================================================================== --- CHANGELOG (revision 6553) +++ CHANGELOG (revision 6554) @@ -24,6 +24,9 @@ TRQ-1102 b - Fixed code so Moab no longer gets a End of File or other premature close messages on the Moab to TORQUE connection. TRQ-1098 + b - Added a modified version of a patch submitted by Matt Ezell for Bugzilla 207. + This fixes a seg-fault in qsub if Moab passes an environment variable without + a value. 4.1.0 e - make free_nodes() only look at nodes in the exec_host list and not examine