This is an automated email from the ASF dual-hosted git repository. gustavonihei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 13741c9017bc2884f31c41db18405be271f20d70 Author: chao.an <anc...@xiaomi.com> AuthorDate: Tue Sep 7 22:54:47 2021 +0800 sched/pidhash: init g_pidhash to NULL to avoid wild pointer Signed-off-by: chao.an <anc...@xiaomi.com> --- sched/sched/sched_gettcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/sched/sched_gettcb.c b/sched/sched/sched_gettcb.c index 776927d..373e218 100644 --- a/sched/sched/sched_gettcb.c +++ b/sched/sched/sched_gettcb.c @@ -76,7 +76,7 @@ FAR struct tcb_s *nxsched_get_tcb(pid_t pid) /* Verify that the correct TCB was found. */ - if (pid == g_pidhash[hash_ndx].pid) + if (g_pidhash && pid == g_pidhash[hash_ndx].pid) { /* Return the TCB associated with this pid (if any) */