From 9c2d94ca1aa1bf03dc8c594e6c167b27a952e41c Mon Sep 17 00:00:00 2001 From: Eladash Date: Wed, 15 Sep 2021 20:33:31 +0300 Subject: [PATCH] sys_prx: Improve sys_prx_get_module_info error checking --- rpcs3/Emu/Cell/lv2/sys_prx.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.cpp b/rpcs3/Emu/Cell/lv2/sys_prx.cpp index 52f404ed87..9f295d455b 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_prx.cpp @@ -801,7 +801,17 @@ error_code _sys_prx_get_module_info(ppu_thread& ppu, u32 id, u64 flags, vm::ptr< return CELL_EFAULT; } - if (pOpt->size != pOpt.size() || !pOpt->info) + if (pOpt->size != pOpt.size()) + { + return CELL_EINVAL; + } + + if (!pOpt->info) + { + return CELL_EFAULT; + } + + if (pOpt->info->size != pOpt->info.size()) { return CELL_EINVAL; }