From 606e4b619c070221f03cd02b18676e0a3cb5c68e Mon Sep 17 00:00:00 2001 From: antifallobst Date: Sat, 11 Mar 2023 10:37:44 +0100 Subject: [PATCH] fix (scheduler): added chunk NULL reference check when resolving processes --- kernel/src/proc/scheduler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/src/proc/scheduler.c b/kernel/src/proc/scheduler.c index 4bbb764..37f9fd9 100644 --- a/kernel/src/proc/scheduler.c +++ b/kernel/src/proc/scheduler.c @@ -255,6 +255,9 @@ process_T* scheduler_get_process(pid_t pid) { uint32_t index_in_chunk = pid % SCHEDULER_PROCESS_CHUNK_SIZE; scheduler_processes_chunk_T* chunk = g_scheduler.processes; + if (chunk == NULL) { + return NULL; + } for (uint32_t i = 0; i < num_chunks; i++) { chunk = chunk->next;