[Kernel] Don't dereference null pointers in SetThreadName.

This commit is contained in:
alan 2018-11-13 07:40:46 -05:00
parent c949ce3d9c
commit bad8c4b0c5
1 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,12 @@ void RtlRaiseException(pointer_t<X_EXCEPTION_RECORD> record) {
reinterpret_cast<X_THREADNAME_INFO*>(&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<const char*>(thread_info->name_ptr);