From 8fc9862614ce9a6d359da0773ab9195daf0251fe Mon Sep 17 00:00:00 2001 From: Ofek Date: Sun, 12 Nov 2017 00:22:38 +0200 Subject: [PATCH] Fix cellGameGet(Set)Param (#3690) * Fix cellGameGet(Set)Param --- rpcs3/Emu/Cell/Modules/cellGame.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index 1f98fa4a35..c278afa8b5 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -659,6 +659,11 @@ error_code cellGameGetParamString(s32 id, vm::ptr buf, u32 bufsize) { cellGame.warning("cellGameGetParamString(id=%d, buf=*0x%x, bufsize=%d)", id, buf, bufsize); + if (!buf || bufsize == 0) + { + return CELL_GAME_ERROR_PARAM; + } + const auto prm = fxm::get(); if (!prm) @@ -685,6 +690,11 @@ error_code cellGameSetParamString(s32 id, vm::cptr buf) { cellGame.warning("cellGameSetParamString(id=%d, buf=*0x%x)", id, buf); + if (!buf) + { + return CELL_GAME_ERROR_PARAM; + } + const auto prm = fxm::get(); if (!prm)