From bad8c4b0c58acbc92545b0da8a8bdbeca404ea77 Mon Sep 17 00:00:00 2001 From: alan Date: Tue, 13 Nov 2018 07:40:46 -0500 Subject: [PATCH] [Kernel] Don't dereference null pointers in SetThreadName. --- src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc index 45510bac2..51878814c 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc @@ -42,6 +42,12 @@ void RtlRaiseException(pointer_t record) { reinterpret_cast(&record->exception_information[0]); assert_true(thread_info->type == 0x1000); + + if (!thread_info->name_ptr) { + XELOGD("SetThreadName called with null name_ptr"); + return; + } + auto name = kernel_memory()->TranslateVirtual(thread_info->name_ptr);