[BASESRV]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Fri, 2 May 2014 23:00:10 +0000 (23:00 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Fri, 2 May 2014 23:00:10 +0000 (23:00 +0000)
Don't accept NULL as a valid console handle.

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

subsystems/win/basesrv/vdm.c

index ba6866c..4f6aad3 100644 (file)
@@ -29,6 +29,9 @@ NTSTATUS NTAPI BaseSrvGetConsoleRecord(HANDLE ConsoleHandle, PVDM_CONSOLE_RECORD
     PLIST_ENTRY i;
     PVDM_CONSOLE_RECORD CurrentRecord = NULL;
 
     PLIST_ENTRY i;
     PVDM_CONSOLE_RECORD CurrentRecord = NULL;
 
+    /* NULL is not a valid console handle */
+    if (ConsoleHandle == NULL) return STATUS_INVALID_PARAMETER;
+
     /* Search for a record that has the same console handle */
     for (i = VDMConsoleListHead.Flink; i != &VDMConsoleListHead; i = i->Flink)
     {
     /* Search for a record that has the same console handle */
     for (i = VDMConsoleListHead.Flink; i != &VDMConsoleListHead; i = i->Flink)
     {