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

Address possible array overflow in squeue

This should not be a problem in v14.03, but the logic will be
  important in v14.11 due to larger job arrays being supported.
parent c037469c
No related branches found
No related tags found
No related merge requests found
......@@ -178,11 +178,14 @@ static bool _merge_job_array(List l, job_info_t * job_ptr)
/* We re-purpose the job's node_inx array to store the
* array_task_id values */
if (!list_job_ptr->node_inx) {
list_job_ptr->node_inx = xmalloc(sizeof(int32_t) * 0xffff);
list_job_ptr->node_inx[0] = 1; /* offset */
list_job_ptr->node_inx[1] =
list_job_ptr->node_inx =
xmalloc(sizeof(int32_t) * 0xffff);
list_job_ptr->node_inx[0] = 1; /* offset */
list_job_ptr->node_inx[1] = /* array task ID */
list_job_ptr->array_task_id;
}
if (list_job_ptr->node_inx[0] >= 0xfffe)
break; /* No more room in node_inx array */
list_job_ptr->node_inx[0]++;
list_job_ptr->node_inx[list_job_ptr->node_inx[0]] =
job_ptr->array_task_id;
......
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