diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-16 04:42:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-16 04:42:51 +0000 |
commit | d4a6324d5f5d6048f599eecc27355105442a0ead (patch) | |
tree | e548be208025471fd1419316b2aa11305a5d7229 /sys/netinet | |
parent | 7772b95a05a84c413437dbf9b735f375ef93f360 (diff) |
udp packets less than min udp packet length are bad; davem@jenolan.rutgers.edu
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 31bdf858ac9..275dbba0c17 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.8 1997/01/26 01:23:46 tholo Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.9 1997/02/16 04:42:50 deraadt Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -143,7 +143,7 @@ udp_input(m, va_alist) */ len = ntohs((u_int16_t)uh->uh_ulen); if (ip->ip_len != len) { - if (len > ip->ip_len) { + if (len > ip->ip_len || len < sizeof(struct udphdr)) { udpstat.udps_badlen++; goto bad; } |