mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
[NTVDM]
Use DOS_CMDLINE_LENGTH instead of MAX_PATH. Fix bug in DosInitializePsp which allowed writing past the end of the Program Segment Prefix (PSP). svn path=/branches/ntvdm/; revision=59693
This commit is contained in:
parent
2288b2c576
commit
b60ee76f22
|
@ -864,7 +864,7 @@ VOID DosInitializePsp(WORD PspSegment, LPCSTR CommandLine, WORD ProgramSize, WOR
|
|||
PspBlock->FarCall[2] = 0xCB; // retf
|
||||
|
||||
/* Set the command line */
|
||||
PspBlock->CommandLineSize = (BYTE)min(strlen(CommandLine), DOS_CMDLINE_LENGTH);
|
||||
PspBlock->CommandLineSize = (BYTE)min(strlen(CommandLine), DOS_CMDLINE_LENGTH - 1);
|
||||
RtlCopyMemory(PspBlock->CommandLine, CommandLine, PspBlock->CommandLineSize);
|
||||
PspBlock->CommandLine[PspBlock->CommandLineSize] = '\r';
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
|||
HANDLE FileHandle = INVALID_HANDLE_VALUE, FileMapping = NULL;
|
||||
LPBYTE Address = NULL;
|
||||
LPSTR ProgramFilePath, Parameters[256];
|
||||
CHAR CommandLineCopy[MAX_PATH];
|
||||
CHAR CommandLineCopy[DOS_CMDLINE_LENGTH];
|
||||
INT ParamCount = 0;
|
||||
WORD Segment = 0;
|
||||
WORD MaxAllocSize;
|
||||
|
|
|
@ -77,7 +77,7 @@ BOOL WINAPI ConsoleCtrlHandler(DWORD ControlType)
|
|||
INT wmain(INT argc, WCHAR *argv[])
|
||||
{
|
||||
INT i;
|
||||
CHAR CommandLine[MAX_PATH];
|
||||
CHAR CommandLine[DOS_CMDLINE_LENGTH];
|
||||
DWORD CurrentTickCount;
|
||||
DWORD LastTickCount = GetTickCount();
|
||||
DWORD Cycles = 0;
|
||||
|
|
Loading…
Reference in a new issue