Patch by Alex Ionescu <alex.ionescu@reactos.org>
authorKJK::Hyperion <hackbunny@reactos.org>
Thu, 22 May 2008 13:19:32 +0000 (13:19 +0000)
committerKJK::Hyperion <hackbunny@reactos.org>
Thu, 22 May 2008 13:19:32 +0000 (13:19 +0000)
See issue #3116 for more details.

svn path=/trunk/; revision=33635

reactos/ntoskrnl/mm/procsup.c

index 13c5eb5..995f96b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
- * FILE:            ntoskrnl/mm/process.c
+ * FILE:            ntoskrnl/mm/procsup.c
  * PURPOSE:         Memory functions related to Processes
  *
  * PROGRAMMERS:     Alex Ionescu (alex@relsoft.net)
@@ -615,20 +615,24 @@ MmInitializeProcessAddressSpace(IN PEPROCESS Process,
         /* Determine the image file name and save it to EPROCESS */
         DPRINT("Getting Image name\n");
         FileName = SectionObject->FileObject->FileName;
-        szSrc = (PWCHAR)(FileName.Buffer + FileName.Length);
-        while (szSrc >= FileName.Buffer)
+        szSrc = (PWCHAR)((PCHAR)FileName.Buffer + FileName.Length);
+        if (FileName.Buffer)
         {
-            /* Make sure this isn't a backslash */
-            if (*--szSrc == OBJ_NAME_PATH_SEPARATOR)
+            /* Loop the file name*/
+            while (szSrc > FileName.Buffer)
             {
-                /* If so, stop it here */
-                szSrc++;
-                break;
-            }
-            else
-            {
-                /* Otherwise, keep going */
-                lnFName++;
+                /* Make sure this isn't a backslash */
+                if (*--szSrc == OBJ_NAME_PATH_SEPARATOR)
+                {
+                    /* If so, stop it here */
+                    szSrc++;
+                    break;
+                }
+                else
+                {
+                    /* Otherwise, keep going */
+                    lnFName++;
+                }
             }
         }
 
@@ -720,3 +724,4 @@ MmDeleteProcessAddressSpace(PEPROCESS Process)
    DPRINT("Finished MmReleaseMmInfo()\n");
    return(STATUS_SUCCESS);
 }
+