From c430a1748adac644a0048bac93822900ab493f78 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:11:50 +0100 Subject: [PATCH] [Kernel] Check for null hmodule_ptr in XexLoadImage --- src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc index 95878e90f..9703a9260 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc @@ -98,6 +98,10 @@ dword_result_t xeXexLoadImage( bool isFromMemory) { X_STATUS result = X_STATUS_NO_SUCH_FILE; + if (!hmodule_ptr) { + return X_ERROR_INVALID_PARAMETER; + } + uint32_t hmodule = 0; auto module = kernel_state()->GetModule(module_name.value()); if (module) {