From 18d7e6e777a5c3103a0eca234d3c9e66c29dddd9 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 16 Feb 1997 04:42:50 +0000 Subject: [PATCH] udp packets less than min udp packet length are bad; davem@jenolan.rutgers.edu --- sys/netinet/udp_usrreq.c | 4 ++-- 1 file 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; } -- 2.20.1