cellSysUtil: Add a few CELL_SYSUTIL_ERROR_VALUE checks

This commit is contained in:
Eladash 2019-11-15 19:17:54 +02:00 committed by Megamouse
parent 894658f14c
commit da12969898

View File

@ -203,6 +203,11 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr<s32> 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<s32> 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<char>
{
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<char>
break;
default:
return CELL_EINVAL;
return CELL_SYSUTIL_ERROR_VALUE;
}
return CELL_OK;