Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NULL dereference in drmaa_job_ps #436

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/drmaa/src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,18 +618,19 @@ int drmaa_job_ps(
const drmaa_attrib_info_t *attr;
attr = attr_by_pbs_name(i->name);

switch (attr->code)
{
if (attr)
switch (attr->code)
{

case ATTR_JOB_STATE:
pbs_state = i->value[0];
break;
case ATTR_JOB_STATE:
pbs_state = i->value[0];
break;

case ATTR_EXIT_STATUS:
exit_status = atoi(i->value);
break;
case ATTR_EXIT_STATUS:
exit_status = atoi(i->value);
break;
}
}
}

if (!rc)
switch (pbs_state)
Expand Down