From aabf3c66955b11424fb564bcdf72ab867faaeced Mon Sep 17 00:00:00 2001 From: scribam Date: Sun, 11 Feb 2018 16:25:36 +0100 Subject: [PATCH] Checks for content_id in sceNpDrmVerifyUpgradeLicense and sceNpDrmVerifyUpgradeLicense2 --- rpcs3/Emu/Cell/Modules/sceNp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index cb1fd1510c..5a1503cb6f 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -140,6 +140,11 @@ s32 sceNpDrmVerifyUpgradeLicense(vm::cptr content_id) { sceNp.warning("sceNpDrmVerifyUpgradeLicense(content_id=%s)", content_id); + if (!content_id) + { + return SCE_NP_DRM_ERROR_INVALID_PARAM; + } + if (!fs::is_file(vfs::get("/dev_hdd0/home/00000001/exdata/") + content_id.get_ptr() + ".rap")) { // Game hasn't been purchased therefore no RAP file present @@ -154,6 +159,11 @@ s32 sceNpDrmVerifyUpgradeLicense2(vm::cptr content_id) { sceNp.warning("sceNpDrmVerifyUpgradeLicense2(content_id=%s)", content_id); + if (!content_id) + { + return SCE_NP_DRM_ERROR_INVALID_PARAM; + } + if (!fs::is_file(vfs::get("/dev_hdd0/home/00000001/exdata/") + content_id.get_ptr() + ".rap")) { // Game hasn't been purchased therefore no RAP file present