aboutsummaryrefslogtreecommitdiff
path: root/primedev/core
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2025-04-18 00:56:48 +0200
committerGitHub <noreply@github.com>2025-04-18 00:56:48 +0200
commit1277b3711d3aedb48e83d854e3c734c2f368c7ef (patch)
treec67e7eea4016a45a61ca2477b25e120f32072e46 /primedev/core
parent98e7b0e011221af53cb9390666ba039a5a4a437b (diff)
downloadNorthstarLauncher-1.30.1.tar.gz
NorthstarLauncher-1.30.1.zip
Fix Null Deref crash (#846)v1.30.1-rc5v1.30.1
Co-authored-by: F1F7Y <filip.bartos07@proton.me> Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
Diffstat (limited to 'primedev/core')
-rw-r--r--primedev/core/filesystem/rpakfilesystem.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/primedev/core/filesystem/rpakfilesystem.cpp b/primedev/core/filesystem/rpakfilesystem.cpp
index c3e5e74e..e3f2a1be 100644
--- a/primedev/core/filesystem/rpakfilesystem.cpp
+++ b/primedev/core/filesystem/rpakfilesystem.cpp
@@ -484,6 +484,14 @@ HOOK(OpenFileHook, o_pOpenFile,
void*, __fastcall, (const char* pPath, void* pCallback))
// clang-format on
{
+ // NOTE [Fifty]: For some reason some users are getting pPath as null when
+ // loading a server, o_pOpenFile uses CreateFileA and checks
+ // its return value so this is completely safe
+ if (pPath == NULL)
+ {
+ return o_pOpenFile(pPath, pCallback);
+ }
+
fs::path path(pPath);
std::string newPath = "";
fs::path filename = path.filename();