networkprotocols/tcpipv4v6prt/src/tcp.cpp
branchRCL_3
changeset 58 8d540f55e491
parent 57 abbed5a4b42a
child 75 c1029e558ef5
--- a/networkprotocols/tcpipv4v6prt/src/tcp.cpp	Tue Aug 31 16:45:15 2010 +0300
+++ b/networkprotocols/tcpipv4v6prt/src/tcp.cpp	Wed Sep 01 12:33:58 2010 +0100
@@ -263,6 +263,13 @@
 #ifdef _LOG
 		LogPacket('<', seg, info, info->iOffset);
 		pkt.Set(seg, info->iOffset, pkt.iHdr->HeaderLength()); // LogPacket() may have realigned the header.
+
+		if (!pkt.iHdr)
+			{
+			LOG(Log::Printf(_L("\ttcp Process() header alignment failed. Packet discarded")));
+			seg.Free();
+			return;
+			}
 #endif
 
 		// Verify TCP checksum