diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index 6e846cedea..cf52bd0556 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -203,6 +203,11 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr valu { cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value); + if (!value) + { + return CELL_SYSUTIL_ERROR_VALUE; + } + // TODO: load this information from config (preferably "sys/" group) switch (id) @@ -272,7 +277,7 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr valu break; default: - return CELL_EINVAL; + return CELL_SYSUTIL_ERROR_VALUE; } return CELL_OK; @@ -282,6 +287,11 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr { cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize); + if (!buf) + { + return CELL_SYSUTIL_ERROR_VALUE; + } + memset(buf.get_ptr(), 0, bufsize); switch (id) @@ -295,7 +305,7 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr break; default: - return CELL_EINVAL; + return CELL_SYSUTIL_ERROR_VALUE; } return CELL_OK;