[BASESRV]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Fri, 2 May 2014 01:18:46 +0000 (01:18 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Fri, 2 May 2014 01:18:46 +0000 (01:18 +0000)
Make sure that the console record exists before continuing.

svn path=/branches/ntvdm/; revision=63099

subsystems/win/basesrv/vdm.c

index 8d3af6f..409a801 100644 (file)
@@ -901,6 +901,13 @@ CSR_API(BaseSrvGetNextVDMCommand)
                                              &ConsoleRecord);
         }
 
                                              &ConsoleRecord);
         }
 
+        /* Make sure we found the console record */
+        if (!NT_SUCCESS(Status))
+        {
+            Status = STATUS_INVALID_PARAMETER;
+            goto Cleanup;
+        }
+
         /* Return the session ID */
         GetNextVdmCommandRequest->iTask = ConsoleRecord->SessionId;
         GetNextVdmCommandRequest->WaitObjectForVDM = NULL;
         /* Return the session ID */
         GetNextVdmCommandRequest->iTask = ConsoleRecord->SessionId;
         GetNextVdmCommandRequest->WaitObjectForVDM = NULL;