mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-28 19:26:16 +00:00
[NTVDM]
Correctly NULL-terminate the command-lines when needed (and avoid buffer overruns). svn path=/trunk/; revision=63365
This commit is contained in:
@@ -119,8 +119,8 @@ static VOID WINAPI DosCmdInterpreterBop(LPWORD Stack)
|
||||
STARTUPINFOA StartupInfo;
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
|
||||
/* NULL-terminate the command by removing the return carriage character */
|
||||
while (*CmdPtr != '\r') CmdPtr++;
|
||||
/* NULL-terminate the command line by removing the return carriage character */
|
||||
while (*CmdPtr && *CmdPtr != '\r') CmdPtr++;
|
||||
*CmdPtr = '\0';
|
||||
|
||||
DPRINT1("CMD Run Command '%s'\n", Command);
|
||||
|
||||
@@ -926,6 +926,10 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType,
|
||||
return ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* NULL-terminate the command line by removing the return carriage character */
|
||||
while (*CommandLine && *CommandLine != '\r') CommandLine++;
|
||||
*(LPSTR)CommandLine = '\0';
|
||||
|
||||
/* Open a handle to the executable */
|
||||
FileHandle = CreateFileA(ExecutablePath,
|
||||
GENERIC_READ,
|
||||
|
||||
Reference in New Issue
Block a user