From e280d54f3f6abd4e1ce540bf08812f346f5a4f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Mon, 19 May 2014 15:05:53 +0200 Subject: [PATCH] Fix pointers issue in cellUserInfoGetList Solves GetMemFromAddr(0x0) on NPEB01894. --- rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp index 088eaa1d1c..5fba6b71a0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp @@ -60,9 +60,17 @@ int cellUserInfoGetList(mem32_t listNum, mem_ptr_t listBuf cellUserInfo.Warning("cellUserInfoGetList(listNum_addr=0x%x, listBuf_addr=0x%x, currentUserId_addr=0x%x)", listNum.GetAddr(), listBuf.GetAddr(), currentUserId.GetAddr()); - listNum = 1; - listBuf->userId[0] = 1; - currentUserId = 1; + // If only listNum is NULL, an should will be returned + if (listBuf.IsGood() && !listNum.IsGood()) + return CELL_USERINFO_ERROR_PARAM; + if (listNum.IsGood()) + listNum = 1; + if (listBuf.IsGood()) + listBuf->userId[0] = 1; + + if (currentUserId.IsGood()) + currentUserId = 1; + return CELL_OK; }