From 55821041bfe5b7d5d5414cc4adb3407f7a784b32 Mon Sep 17 00:00:00 2001 From: TGEnigma Date: Sat, 27 Jan 2018 15:01:33 +0100 Subject: [PATCH] core/GUI: Fix null pointer dereference --- rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp index b5cb274c18..f66d805354 100644 --- a/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp @@ -315,6 +315,11 @@ s32 cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::cptr msgStrin { cellSysutil.warning("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString=%s)", progressBarIndex, msgString); + if (!msgString) + { + return CELL_MSGDIALOG_ERROR_PARAM; + } + if (auto rsxthr = fxm::get()) { if (auto dlg2 = rsxthr->shell_get_current_dialog()) @@ -331,7 +336,7 @@ s32 cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::cptr msgStrin 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; }