From 632cc79c5454597584ad45892e89e5564da33936 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 24 Mar 2018 15:32:33 +0100 Subject: [PATCH] cellGame: add more checks --- rpcs3/Emu/Cell/Modules/cellGame.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index 822b716bd5..c5cc64bca1 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -964,11 +964,11 @@ error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::cptr CELL_GAME_ERRDIALOG_NOSPACE); } -s32 cellGameThemeInstall(vm::cptr usrdirPath, vm::cptr fileName, u32 option) +error_code cellGameThemeInstall(vm::cptr usrdirPath, vm::cptr fileName, u32 option) { cellGame.todo("cellGameThemeInstall(usrdirPath=%s, fileName=%s, option=0x%x)", usrdirPath, fileName, option); - if (!fileName || !usrdirPath || !memchr(usrdirPath.get_ptr(), '\0', CELL_GAME_PATH_MAX)) + if (!usrdirPath || !fileName || !memchr(usrdirPath.get_ptr(), '\0', CELL_GAME_PATH_MAX) || option > CELL_GAME_THEME_OPTION_APPLY) { return CELL_GAME_ERROR_PARAM; } @@ -980,6 +980,11 @@ error_code cellGameThemeInstallFromBuffer(u32 fileSize, u32 bufSize, vm::ptr bufSize && !func) || bufSize <= 4095 || option > CELL_GAME_THEME_OPTION_APPLY) + { + return CELL_GAME_ERROR_PARAM; + } + return CELL_OK; }