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.29 retrieving revision 1.29.2.1 diff -u -p -r1.29 -r1.29.2.1 --- src/sys/netinet/udp_usrreq.c 1996/05/20 16:56:20 1.29 +++ src/sys/netinet/udp_usrreq.c 1996/11/10 21:57:55 1.29.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.29 1996/05/20 16:56:20 mrg Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.29.2.1 1996/11/10 21:57:55 thorpej Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -462,6 +462,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. */