From d4888a49738d055122294eed44d8bc6a98bdb30c Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 12 Jan 2019 22:10:44 +0100 Subject: [PATCH] cellSysCacheMount: don't return RET_OK_RELAYED on empty cacheId The system cache is supposed to be cleared but I don't think we wanna do that --- rpcs3/Emu/Cell/Modules/cellSysutil.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index 22cef83e7d..4b66dc40d0 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -297,7 +297,6 @@ s32 cellSysutilUnregisterCallback(u32 slot) s32 cellSysCacheClear() { - cellSysutil.warning("cellSysCacheClear()"); // Get the param as a shared ptr, then decipher the cacheid from it @@ -329,15 +328,18 @@ s32 cellSysCacheMount(vm::ptr param) { cellSysutil.warning("cellSysCacheMount(param=*0x%x)", param); - const std::string& cache_id = param->cacheId; - verify(HERE), cache_id.size() < sizeof(param->cacheId); + if (!param || !memchr(param->cacheId, '\0', CELL_SYSCACHE_ID_SIZE)) + { + return CELL_SYSCACHE_ERROR_PARAM; + } + const std::string& cache_id = param->cacheId; const std::string& cache_path = "/dev_hdd1/cache/" + cache_id; strcpy_trunc(param->getCachePath, cache_path); // TODO: implement (what?) fxm::make_always(*param); - if (!fs::create_dir(vfs::get(cache_path))) + if (!fs::create_dir(vfs::get(cache_path)) && !cache_id.empty()) { return CELL_SYSCACHE_RET_OK_RELAYED; }