From 36d73c2c626869ad9bfc6aa972739b0e17f0436d Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Tue, 3 Jun 2014 22:34:49 +0000 Subject: [PATCH] [NTVDM] Fix the command line NULL-termination. svn path=/trunk/; revision=63538 --- reactos/subsystems/ntvdm/dos/dos32krnl/dos.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c b/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c index b4c565f9f1a..a9aa39d6e52 100644 --- a/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c +++ b/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c @@ -915,6 +915,7 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, PIMAGE_DOS_HEADER Header; PDWORD RelocationTable; PWORD RelocWord; + LPSTR CmdLinePtr = (LPSTR)CommandLine; DPRINT1("DosLoadExecutable(%d, %s, %s, %s, 0x%08X, 0x%08X)\n", LoadType, @@ -931,8 +932,8 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, } /* NULL-terminate the command line by removing the return carriage character */ - while (*CommandLine && *CommandLine != '\r') CommandLine++; - *(LPSTR)CommandLine = '\0'; + while (*CmdLinePtr && *CmdLinePtr != '\r') CmdLinePtr++; + *CmdLinePtr = '\0'; /* Open a handle to the executable */ FileHandle = CreateFileA(ExecutablePath,