proc_mgnt: check if there's a pending client before dereference pointer
authorReto Achermann <reto.achermann@inf.ethz.ch>
Sun, 30 Jun 2019 08:38:06 +0000 (10:38 +0200)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Sun, 30 Jun 2019 08:38:06 +0000 (10:38 +0200)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

usr/proc_mgmt/service.c

index f24ea67..f827479 100644 (file)
@@ -72,6 +72,11 @@ static void spawn_reply_handler(struct spawn_binding *b, errval_t spawn_err)
     struct pending_client *cl =
             (struct pending_client*) spawnd_state_dequeue_recv(b->st);
 
+    /* there's no pending client, return */
+    if (cl == NULL) {
+        return;    
+    }
+
     struct pending_spawn *spawn = NULL;
     struct pending_span *span = NULL;
     struct pending_kill_cleanup *kc = NULL;