Skip to content
Snippets Groups Projects
Commit e79617da authored by Morris Jette's avatar Morris Jette
Browse files

job_submit/pbs - Fix for incorrect malloc size

This bug in the new plugin would result in memory corruption.
parent 07a5f8ec
No related branches found
No related tags found
No related merge requests found
......@@ -126,8 +126,8 @@ static void _add_env2(struct job_descriptor *job_desc, char *key, char *val)
if (!job_desc->environment || !key || !val)
return; /* Nothing we can do for interactive jobs */
len = sizeof(key) + sizeof(val) + 2;
new_env = xmalloc(sizeof(len));
len = strlen(key) + strlen(val) + 2;
new_env = xmalloc(len);
snprintf(new_env, len, "%s=%s", key, val);
_add_env(job_desc, new_env);
xfree(new_env);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment