Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -p -r1.38 -r1.39 --- src/sys/netinet/udp_usrreq.c 1996/10/16 19:33:39 1.38 +++ src/sys/netinet/udp_usrreq.c 1996/10/25 06:35:16 1.39 @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.38 1996/10/16 19:33:39 ws Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.39 1996/10/25 06:35:16 thorpej Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -450,6 +450,15 @@ udp_output(m, va_alist) } /* + * Compute the packet length of the IP header, and + * punt if the length looks bogus. + */ + if ((len + sizeof(struct udpiphdr)) > IP_MAXPACKET) { + error = EMSGSIZE; + goto release; + } + + /* * Fill in mbuf with extended UDP header * and addresses and length put into network format. */