Author: cgutman
Date: Thu Sep 25 22:03:55 2008
New Revision: 36524
URL:
http://svn.reactos.org/svn/reactos?rev=36524&view=rev
Log:
- Fail if From is NULL
- Fixes Coverity error 652
Modified:
branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Thu Sep 25
22:03:55 2008
@@ -194,6 +194,8 @@
ULONG TdiAddressSize;
PTDI_CONNECTION_INFORMATION FromTdiConn, ToTdiConn;
+ if (!From) return STATUS_INVALID_PARAMETER;
+
/* FIXME: Get from socket information */
TdiAddressSize = TdiAddressSizeFromType(From->Address[0].AddressType);
SizeOfEntry = TdiAddressSize + sizeof(TDI_CONNECTION_INFORMATION);
@@ -207,15 +209,10 @@
RtlZeroMemory( LayoutFrame, 2 * SizeOfEntry );
- FromTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame;
- ToTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame + SizeOfEntry;
-
- if (From != NULL) {
- TdiBuildConnectionInfoInPlace( FromTdiConn, From );
- } else {
- TdiBuildNullConnectionInfoInPlace( FromTdiConn,
- From->Address[0].AddressType );
- }
+ FromTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame;
+ ToTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame + SizeOfEntry;
+
+ TdiBuildConnectionInfoInPlace( FromTdiConn, From );
TdiBuildConnectionInfoInPlace( ToTdiConn, To );