Author: aandrejevic
Date: Sat May 17 15:29:07 2014
New Revision: 63331
URL:
http://svn.reactos.org/svn/reactos?rev=63331&view=rev
Log:
[NTVDM]
DosResizeMemory shouldn't succeed unless the memory block has been resized to the
specified amount.
Modified:
trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Sat May 17 15:29:07
2014
@@ -248,6 +248,14 @@
/* Set the maximum possible size of the block */
ReturnSize += NextMcb->Size + 1;
+
+ if (ReturnSize < NewSize)
+ {
+ DPRINT("Cannot expand memory block: insufficient free segments
available!\n");
+ DosLastError = ERROR_NOT_ENOUGH_MEMORY;
+ Success = FALSE;
+ goto Done;
+ }
/* Maximize the current block */
Mcb->Size = ReturnSize;