[ros-diffs] [cgutman] 37009: - Check that we got the port that we wanted if we specified one

cgutman at svn.reactos.org cgutman at svn.reactos.org
Mon Oct 27 04:26:22 CET 2008


Author: cgutman
Date: Sun Oct 26 22:26:21 2008
New Revision: 37009

URL: http://svn.reactos.org/svn/reactos?rev=37009&view=rev
Log:
 - Check that we got the port that we wanted if we specified one

Modified:
    branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c

Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c?rev=37009&r1=37008&r2=37009&view=diff
==============================================================================
--- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Sun Oct 26 22:26:21 2008
@@ -285,6 +285,14 @@
   case IPPROTO_TCP:
       AddrFile->Port =
           TCPAllocatePort(Address->Address[0].Address[0].sin_port);
+
+      if (Address->Address[0].Address[0].sin_port &&
+          AddrFile->Port != Address->Address[0].Address[0].sin_port)
+      {
+          ExFreePool(AddrFile);
+          return STATUS_INVALID_PARAMETER;
+      }
+
       AddrFile->Send = NULL; /* TCPSendData */
       break;
 
@@ -292,6 +300,14 @@
       TI_DbgPrint(MID_TRACE,("Allocating udp port\n"));
       AddrFile->Port =
 	  UDPAllocatePort(Address->Address[0].Address[0].sin_port);
+
+      if (Address->Address[0].Address[0].sin_port &&
+          AddrFile->Port != Address->Address[0].Address[0].sin_port)
+      {
+          ExFreePool(AddrFile);
+          return STATUS_INVALID_PARAMETER;
+      }
+
       TI_DbgPrint(MID_TRACE,("Setting port %d (wanted %d)\n",
                              AddrFile->Port,
                              Address->Address[0].Address[0].sin_port));



More information about the Ros-diffs mailing list