aboutsummaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 2eab1ca4..eb73590c 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -2640,6 +2640,9 @@ thread_set_name(
thread_t thread,
const_kernel_debug_name_t name)
{
+ if (thread == THREAD_NULL)
+ return KERN_INVALID_ARGUMENT;
+
strncpy(thread->name, name, sizeof thread->name - 1);
thread->name[sizeof thread->name - 1] = '\0';
return KERN_SUCCESS;