diff options
author | 1998-12-15 02:26:35 +0000 | |
---|---|---|
committer | 1998-12-15 02:26:35 +0000 | |
commit | 2174a81819e30db3c5fde060a70120b6a64c1e62 (patch) | |
tree | 14f4fe2e72d7d68d4bdcd72625e14f3c4e1f5859 | |
parent | always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.net (diff) | |
download | wireguard-openbsd-2174a81819e30db3c5fde060a70120b6a64c1e62.tar.xz wireguard-openbsd-2174a81819e30db3c5fde060a70120b6a64c1e62.zip |
check for valid ip_hl too; route@infonexus.com
-rw-r--r-- | sys/netinet/raw_ip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 5ca4b919dcc..36a70c186b5 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.11 1998/05/18 21:11:04 provos Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.12 1998/12/15 02:26:35 deraadt Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -201,7 +201,8 @@ rip_output(m, va_alist) * and don't allow packet length sizes that will crash */ if ((ip->ip_hl != (sizeof (*ip) >> 2) && inp->inp_options) || - ip->ip_len > m->m_pkthdr.len) { + ip->ip_len > m->m_pkthdr.len || + ip->ip_len < ip->ip_hl << 2) { m_freem(m); return (EINVAL); } |