[LDR] Don't dereference a possible nullptr
authorMark Jansen <mark.jansen@reactos.org>
Fri, 28 Dec 2018 18:25:43 +0000 (19:25 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Thu, 3 Jan 2019 21:52:06 +0000 (22:52 +0100)
dll/ntdll/ldr/ldrinit.c

index bc72c95..d28cb6e 100644 (file)
@@ -2135,8 +2135,10 @@ LdrpInitializeProcess(IN PCONTEXT Context,
         if (FreeCurDir) RtlFreeUnicodeString(&CurrentDirectory);
     }
 
-    /* Check if we should look for a .local file */
-    if (ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH)
+    /* Check if we should look for a .local file 
+        FIXME: Thomas suggested that this check might actually be reversed, we should check this file
+               if the flag is NOT set. */
+    if (ProcessParameters && (ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH))
     {
         /* FIXME */
         DPRINT1("We don't support .local overrides yet\n");