diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index eb92eefb..78088d6f 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -72,6 +72,9 @@ int PS4_SYSV_ABI posix_open(const char* path, int flags, /* SceKernelMode*/ u16 } int PS4_SYSV_ABI sceKernelClose(int d) { + if (d < 3) { // d probably hold an error code + return ORBIS_KERNEL_ERROR_EPERM; + } auto* h = Common::Singleton::Instance(); auto* file = h->GetFile(d); if (file == nullptr) {