From 38cc92ec459ffae037627393f3165cbd807384ae Mon Sep 17 00:00:00 2001 From: TGEnigma Date: Fri, 6 Apr 2018 22:57:33 +0200 Subject: [PATCH] Add _sys_ppu_thread_create and sys_ppu_thread_rename error checks --- rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp index 979db32e64..1482422853 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp @@ -288,6 +288,14 @@ error_code _sys_ppu_thread_create(vm::ptr thread_id, vm::ptr CELL_ENOMEM + // unk is set to 0 in sys_ppu_thread_create stub + + if (!param || !param->entry) + { + return CELL_EFAULT; + } + if (prio < 0 || prio > 3071) { return CELL_EINVAL; @@ -404,6 +412,11 @@ error_code sys_ppu_thread_rename(u32 thread_id, vm::cptr name) return CELL_ESRCH; } + if (!name) + { + return CELL_EFAULT; + } + // thread_ctrl name is not changed (TODO) thread->ppu_name.assign(name.get_ptr()); return CELL_OK;