patch-2.3.19 linux/net/ipx/af_ipx.c

Next file: linux/net/irda/Config.in
Previous file: linux/net/ipx/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.18/linux/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
@@ -744,7 +744,9 @@
 
 	if(ipx->ipx_type == IPX_TYPE_PPROP
 		&& ipx->ipx_tctrl < 8 
-		&& skb->pkt_type != PACKET_OTHERHOST) 
+		&& skb->pkt_type != PACKET_OTHERHOST
+		   /* header + 8 network numbers */ 
+		&& ntohs(ipx->ipx_pktsize) >= sizeof(struct ipxhdr) + 8 * 4) 
 	{
 		int i;
         	ipx_interface *ifcs;
@@ -2043,6 +2045,10 @@
 	
 	/* Too small? */
 	if(ntohs(ipx->ipx_pktsize) < sizeof(struct ipxhdr))
+		goto drop;
+
+	/* Invalid header */
+	if(ntohs(ipx->ipx_pktsize) > skb->len)
 		goto drop;
 		
 	/* Not ours */	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)