mm/mm_heap: check NULL dereferencing on sched_gettcb
This commit fixs SVACE issue as shown below:
WID:5110285 Return value of a function 'sched_gettcb'
is dereferenced at mm_heapinfo.c:374 without checking,
but it is usually checked for this function (42/43).
@@ -371,8 +371,10 @@ void heapinfo_update_group_info(pid_t pid, int group, int type)
group_info[info_idx].pid = pid;
group_info[info_idx].group = group;
tcb = sched_gettcb(pid);
+ if (tcb) {
group_info[info_idx].stack_size = tcb->adj_stack_size;
heapinfo_update_group(tcb->adj_stack_size, pid);
+ }
break;
}
}
