From 42c3d4eff773ea6e8e58e246ac2c47637cb7024b Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 11 Jan 2023 23:16:44 +0100 Subject: [PATCH] Fix NULL pointer --- xtldr/modules/xtos/xtos.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xtldr/modules/xtos/xtos.c b/xtldr/modules/xtos/xtos.c index 40edc52..156221e 100644 --- a/xtldr/modules/xtos/xtos.c +++ b/xtldr/modules/xtos/xtos.c @@ -99,6 +99,7 @@ XtBootSystem(IN PXT_BOOT_PROTOCOL_PARAMETERS Parameters) Parameters->SystemPath = L"\\ExectOS"; } + /* Check if kernel file is set */ if(Parameters->KernelFile == NULL) { /* No kernel filename set, fallback to default */ @@ -106,6 +107,13 @@ XtBootSystem(IN PXT_BOOT_PROTOCOL_PARAMETERS Parameters) Parameters->KernelFile = L"xtoskrnl.exe"; } + /* Check if provided any kernel boot arguments */ + if(Parameters->Arguments == NULL) + { + /* No argument supplied */ + Parameters->Arguments = L""; + } + /* Print a debug message */ XtLdrProtocol->DbgPrint(L"[XTOS] ARC Path: %S\n" L"[XTOS] System Path: %S\n"