mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 06:55:09 +00:00
Implement sysutil_check_name_string
* Fully implement 3, 4, 16 and 17 error checks of cellSaveData. * cellSysCacheMount restrict characters in ID. * cellHddGameCheck restricts characters in dirName.
This commit is contained in:
parent
7519e36317
commit
1986944c61
5 changed files with 134 additions and 9 deletions
|
|
@ -115,13 +115,13 @@ error_code cellSysCacheMount(vm::ptr<CellSysCacheParam> param)
|
|||
|
||||
const auto cache = g_fxo->get<syscache_info>();
|
||||
|
||||
if (!param || !std::memchr(param->cacheId, '\0', CELL_SYSCACHE_ID_SIZE))
|
||||
if (!param || (param->cacheId[0] && sysutil_check_name_string(param->cacheId, 1, CELL_SYSCACHE_ID_SIZE) != 0))
|
||||
{
|
||||
return CELL_SYSCACHE_ERROR_PARAM;
|
||||
}
|
||||
|
||||
// Full virtualized cache id (with title id included)
|
||||
std::string cache_id = vfs::escape(Emu.GetTitleID() + '_' + param->cacheId, true);
|
||||
std::string cache_id = vfs::escape(Emu.GetTitleID() + '_' + param->cacheId);
|
||||
|
||||
// Full path to virtual cache root (/dev_hdd1)
|
||||
std::string new_path = cache->cache_root + cache_id + '/';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue