core/GUI: Fix null pointer dereference

This commit is contained in:
TGEnigma 2018-01-27 15:01:33 +01:00 committed by kd-11
parent e7537cded5
commit 55821041bf

View file

@ -315,6 +315,11 @@ s32 cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::cptr<char> msgStrin
{ {
cellSysutil.warning("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString=%s)", progressBarIndex, msgString); cellSysutil.warning("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString=%s)", progressBarIndex, msgString);
if (!msgString)
{
return CELL_MSGDIALOG_ERROR_PARAM;
}
if (auto rsxthr = fxm::get<GSRender>()) if (auto rsxthr = fxm::get<GSRender>())
{ {
if (auto dlg2 = rsxthr->shell_get_current_dialog()) if (auto dlg2 = rsxthr->shell_get_current_dialog())
@ -331,7 +336,7 @@ s32 cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::cptr<char> msgStrin
return CELL_MSGDIALOG_ERROR_DIALOG_NOT_OPENED; return CELL_MSGDIALOG_ERROR_DIALOG_NOT_OPENED;
} }
if (progressBarIndex >= dlg->type.progress_bar_count || !msgString) if (progressBarIndex >= dlg->type.progress_bar_count)
{ {
return CELL_MSGDIALOG_ERROR_PARAM; return CELL_MSGDIALOG_ERROR_PARAM;
} }