From d0b15ff8c9c7d3e0195a4325a84e2b847e42b7e3 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:00:46 +0000 Subject: [PATCH] [Kernel] Check null pointer in RtlImageXexHeaderField --- src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc index f34cec4f6..d057ebe48 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc @@ -503,6 +503,10 @@ pointer_result_t RtlImageXexHeaderField_entry(pointer_t xex_header, uint32_t field_value = 0; uint32_t field = field_dword; // VS acts weird going from dword_t -> enum + if (!xex_header) { + return field_value; + } + UserModule::GetOptHeader(kernel_memory(), xex_header, xex2_header_keys(field), &field_value);