From 7475be99ab888ed38801e3a8e4565e81d9d8aa23 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 1 Nov 2019 21:22:43 +0200 Subject: [PATCH] lv2: Check ipc_key value if object is process shared --- rpcs3/Emu/Cell/lv2/sys_event.cpp | 5 +++++ rpcs3/Emu/Cell/lv2/sys_sync.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/rpcs3/Emu/Cell/lv2/sys_event.cpp b/rpcs3/Emu/Cell/lv2/sys_event.cpp index afc7fda33d..a3269e202d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_event.cpp @@ -420,6 +420,11 @@ error_code sys_event_port_connect_ipc(ppu_thread& ppu, u32 eport_id, u64 ipc_key sys_event.warning("sys_event_port_connect_ipc(eport_id=0x%x, ipc_key=0x%x)", eport_id, ipc_key); + if (ipc_key == 0) + { + return CELL_EINVAL; + } + auto queue = lv2_event_queue::find(ipc_key); std::lock_guard lock(id_manager::g_mutex); diff --git a/rpcs3/Emu/Cell/lv2/sys_sync.h b/rpcs3/Emu/Cell/lv2/sys_sync.h index 53c47b08f4..b9d1b32335 100644 --- a/rpcs3/Emu/Cell/lv2/sys_sync.h +++ b/rpcs3/Emu/Cell/lv2/sys_sync.h @@ -162,6 +162,11 @@ public: { case SYS_SYNC_PROCESS_SHARED: { + if (ipc_key == 0) + { + return CELL_EINVAL; + } + switch (flags) { case SYS_SYNC_NEWLY_CREATED: