Merge pull request #1260 from alan-shaffer/thread-name-fix

[Kernel] Don't dereference null pointers in SetThreadName.
This commit is contained in:
Rick Gibbed 2018-11-17 16:40:23 -06:00 committed by GitHub
commit b8b1775837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);