From 4620fa8bd8c767c80d43e0623fa66a9282d56e8e Mon Sep 17 00:00:00 2001 From: jjsat Date: Mon, 5 Feb 2018 20:09:07 +0100 Subject: [PATCH] Return parameter error if the result of funcFixed is invalid. --- rpcs3/Emu/Cell/Modules/cellSaveData.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index 59a6a70575..ad38c68683 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -400,8 +400,14 @@ static NEVER_INLINE s32 savedata_op(ppu_thread& ppu, u32 operation, u32 version, // Fixed Callback funcFixed(ppu, result, listGet, fixedSet); + // check result for validity - CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM is not a valid result for funcFixed + if (result->result < CELL_SAVEDATA_CBRESULT_ERR_INVALID || result->result >= CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + { + return CELL_SAVEDATA_ERROR_PARAM; + } + // skip all following steps if OK_LAST - if (result->result == CELL_SAVEDATA_CBRESULT_OK_LAST || result->result == CELL_SAVEDATA_CBRESULT_OK_LAST_NOCONFIRM) + if (result->result == CELL_SAVEDATA_CBRESULT_OK_LAST) { return CELL_OK; }