- Fix parameter checks in NtAcceptConnectPort.
authorAlex Ionescu <aionescu@gmail.com>
Mon, 30 Oct 2006 16:50:20 +0000 (16:50 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 30 Oct 2006 16:50:20 +0000 (16:50 +0000)
- Make CSRSS properly fill out the ServerView structure's length so that it can be validated by the kernel.

svn path=/trunk/; revision=24677

reactos/ntoskrnl/lpc/ntlpc/complete.c
reactos/subsystems/win32/csrss/api/wapi.c

index 27376b8..44b2f52 100644 (file)
@@ -65,14 +65,14 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle,
              ServerView);\r
 \r
     /* Validate the size of the server view */\r
-    if ((ServerView) && (ServerView->Length != sizeof(PORT_VIEW)))\r
+    if ((ServerView) && (ServerView->Length != sizeof(REMOTE_PORT_VIEW)))\r
     {\r
         /* Invalid size */\r
         return STATUS_INVALID_PARAMETER;\r
     }\r
 \r
     /* Validate the size of the client view */\r
-    if ((ClientView) && (ClientView->Length != sizeof(REMOTE_PORT_VIEW)))\r
+    if ((ClientView) && (ClientView->Length != sizeof(PORT_VIEW)))\r
     {\r
         /* Invalid size */\r
         return STATUS_INVALID_PARAMETER;\r
index b218156..5ac6957 100644 (file)
@@ -222,6 +222,7 @@ ServerApiPortThread (PVOID PortHandle)
    for (;;)
      {
         REMOTE_PORT_VIEW LpcRead;
+        LpcRead.Length = sizeof(LpcRead);
         ServerPort = NULL;
 
        Status = NtListenPort (hApiListenPort, Request);