Make sure object attributes pointer is non-NULL before reading from it

This commit is contained in:
Dr. Chat 2015-05-16 15:24:23 -05:00
parent 6239ff9616
commit 4af14884ed
1 changed files with 9 additions and 3 deletions

View File

@ -596,7 +596,9 @@ SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_state, KernelState* state) {
// TODO(benvanik): check for name collision. May return existing object if // TODO(benvanik): check for name collision. May return existing object if
// type matches. // type matches.
AssertNoNameCollision(state, obj_attributes_ptr); if (obj_attributes_ptr) {
AssertNoNameCollision(state, obj_attributes_ptr);
}
XSemaphore* sem = new XSemaphore(state); XSemaphore* sem = new XSemaphore(state);
sem->Initialize(count, limit); 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 // TODO(benvanik): check for name collision. May return existing object if
// type matches. // type matches.
AssertNoNameCollision(state, obj_attributes_ptr); if (obj_attributes_ptr) {
AssertNoNameCollision(state, obj_attributes_ptr);
}
XMutant* mutant = new XMutant(state); XMutant* mutant = new XMutant(state);
mutant->Initialize(initial_owner ? true : false); 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 // TODO(benvanik): check for name collision. May return existing object if
// type matches. // type matches.
AssertNoNameCollision(state, obj_attributes_ptr); if (obj_attributes_ptr) {
AssertNoNameCollision(state, obj_attributes_ptr);
}
XTimer* timer = new XTimer(state); XTimer* timer = new XTimer(state);
timer->Initialize(timer_type); timer->Initialize(timer_type);