Permalink
Browse files

Savedata: Return error when bufSize is too small.

Mirrors what a PSP does.
  • Loading branch information...
unknownbrackets committed Aug 11, 2018
1 parent 718053e commit 42feade4607d692569534a41881c10d33f29a52f
Showing with 4 additions and 0 deletions.
  1. +4 −0 Core/Dialog/SavedataParam.cpp
@@ -362,6 +362,10 @@ int SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &saveD
if (!param) {
return SCE_UTILITY_SAVEDATA_ERROR_SAVE_MS_NOSPACE;
}
if (param->dataSize > param->dataBufSize) {
ERROR_LOG_REPORT(SCEUTILITY, "Savedata buffer overflow: %d / %d", param->dataSize, param->dataBufSize);
return SCE_UTILITY_SAVEDATA_ERROR_RW_BAD_PARAMS;
}
if (param->secureVersion > 3) {
ERROR_LOG_REPORT(SCEUTILITY, "Savedata version requested on save: %d", param->secureVersion);
return SCE_UTILITY_SAVEDATA_ERROR_SAVE_PARAM;

0 comments on commit 42feade

Please sign in to comment.