diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-21 23:06:22 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-21 23:06:22 +0100 |
commit | fb3cc15b1662f00c11d889584f6bc8e3a853c947 (patch) | |
tree | d19d92425bababb57440e36ed2dbd20dc25f8e3b | |
parent | e9a5755233568e3382a13221b23103d500cd0182 (diff) | |
download | gnumach-fb3cc15b1662f00c11d889584f6bc8e3a853c947.tar.gz gnumach-fb3cc15b1662f00c11d889584f6bc8e3a853c947.tar.bz2 gnumach-fb3cc15b1662f00c11d889584f6bc8e3a853c947.zip |
thread_terminate_release: Error out early if thread is NULL
We do not want to destroy the port and release the stack if thread is
NULL, i.e. we will fail.
-rw-r--r-- | kern/thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c index 08d685ec..0e3cc2c9 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -869,6 +869,9 @@ kern_return_t thread_terminate_release( if (task == NULL) return KERN_INVALID_ARGUMENT; + if (thread == NULL) + return KERN_INVALID_ARGUMENT; + mach_port_deallocate(task->itk_space, thread_name); if (reply_port != MACH_PORT_NULL) |