From f413ec09dfc64253df40d49f288a4a0d651d8b83 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 13 Jun 2024 15:00:10 +0300 Subject: [PATCH] return error code if sceKernelLoadStartModule module is invalid --- src/core/libraries/kernel/libkernel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/libraries/kernel/libkernel.cpp b/src/core/libraries/kernel/libkernel.cpp index f21a0f3dd..8b26ab664 100644 --- a/src/core/libraries/kernel/libkernel.cpp +++ b/src/core/libraries/kernel/libkernel.cpp @@ -178,6 +178,9 @@ s32 PS4_SYSV_ABI sceKernelLoadStartModule(const char* moduleFileName, size_t arg // Load PRX module and relocate any modules that import it. auto* linker = Common::Singleton::Instance(); u32 handle = linker->LoadModule(path); + if (handle == -1) { + return ORBIS_KERNEL_ERROR_EINVAL; + } auto* module = linker->GetModule(handle); linker->RelocateAnyImports(module);