Author: aandrejevic
Date: Sat Aug 10 21:41:20 2013
New Revision: 59693
URL:
http://svn.reactos.org/svn/reactos?rev=59693&view=rev
Log:
[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).
Modified:
branches/ntvdm/subsystems/ntvdm/dos.c
branches/ntvdm/subsystems/ntvdm/ntvdm.c
Modified: branches/ntvdm/subsystems/ntvdm/dos.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sat Aug 10 21:41:20 2013
@@ -864,7 +864,7 @@
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 @@
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;
Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Sat Aug 10 21:41:20 2013
@@ -77,7 +77,7 @@
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;