https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8547a8f20aa795c59c710ff5704d40e029753f2

commit d8547a8f20aa795c59c710ff5704d40e029753f2
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Tue Nov 3 01:28:14 2020 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Tue Nov 3 01:52:47 2020 +0100

    [FREELDR] In LoadReactOSSetup(), verify that our BootType is really 
ReactOSSetup.
---
 boot/freeldr/freeldr/ntldr/setupldr.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/boot/freeldr/freeldr/ntldr/setupldr.c 
b/boot/freeldr/freeldr/ntldr/setupldr.c
index 1443a7dd635..ec1aafe0f7b 100644
--- a/boot/freeldr/freeldr/ntldr/setupldr.c
+++ b/boot/freeldr/freeldr/ntldr/setupldr.c
@@ -212,6 +212,19 @@ LoadReactOSSetup(
         NULL
     };
 
+    /* Retrieve the (mandatory) boot type */
+    ArgValue = GetArgumentValue(Argc, Argv, "BootType");
+    if (!ArgValue || !*ArgValue)
+    {
+        ERR("No 'BootType' value, aborting!\n");
+        return EINVAL;
+    }
+    if (_stricmp(ArgValue, "ReactOSSetup") != 0)
+    {
+        ERR("Unknown 'BootType' value '%s', aborting!\n", ArgValue);
+        return EINVAL;
+    }
+
     /* Retrieve the (mandatory) system partition */
     SystemPartition = GetArgumentValue(Argc, Argv, "SystemPartition");
     if (!SystemPartition || !*SystemPartition)

Reply via email to