From 4af14884edc0c9a619639fdb07eeb83965d26bfd Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sat, 16 May 2015 15:24:23 -0500 Subject: [PATCH] Make sure object attributes pointer is non-NULL before reading from it --- src/xenia/kernel/xboxkrnl_threading.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl_threading.cc b/src/xenia/kernel/xboxkrnl_threading.cc index a1c4f296e..2c4813de7 100644 --- a/src/xenia/kernel/xboxkrnl_threading.cc +++ b/src/xenia/kernel/xboxkrnl_threading.cc @@ -596,7 +596,9 @@ SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_state, KernelState* state) { // TODO(benvanik): check for name collision. May return existing object if // type matches. - AssertNoNameCollision(state, obj_attributes_ptr); + if (obj_attributes_ptr) { + AssertNoNameCollision(state, obj_attributes_ptr); + } XSemaphore* sem = new XSemaphore(state); sem->Initialize(count, limit); @@ -690,7 +692,9 @@ SHIM_CALL NtCreateMutant_shim(PPCContext* ppc_state, KernelState* state) { // TODO(benvanik): check for name collision. May return existing object if // type matches. - AssertNoNameCollision(state, obj_attributes_ptr); + if (obj_attributes_ptr) { + AssertNoNameCollision(state, obj_attributes_ptr); + } XMutant* mutant = new XMutant(state); mutant->Initialize(initial_owner ? true : false); @@ -747,7 +751,9 @@ SHIM_CALL NtCreateTimer_shim(PPCContext* ppc_state, KernelState* state) { // TODO(benvanik): check for name collision. May return existing object if // type matches. - AssertNoNameCollision(state, obj_attributes_ptr); + if (obj_attributes_ptr) { + AssertNoNameCollision(state, obj_attributes_ptr); + } XTimer* timer = new XTimer(state); timer->Initialize(timer_type);