diff options
| author | 2003-02-15 16:43:10 +0000 | |
|---|---|---|
| committer | 2003-02-15 16:43:10 +0000 | |
| commit | bc1792f66f248e00814da843f1337746716edc88 (patch) | |
| tree | 3293001dc6119deecbc347f8c60499e8c6240a70 /sys/netinet/raw_ip.c | |
| parent | and the copyright goes here too (diff) | |
| download | wireguard-openbsd-bc1792f66f248e00814da843f1337746716edc88.tar.xz wireguard-openbsd-bc1792f66f248e00814da843f1337746716edc88.zip | |
rip_output: make sure a full ip header is passed for INP_HDRINCL; ok deraadt@
Diffstat (limited to 'sys/netinet/raw_ip.c')
| -rw-r--r-- | sys/netinet/raw_ip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 99b863b91a4..a9f2a739763 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.26 2002/06/09 16:26:11 itojun Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.27 2003/02/15 16:43:10 markus Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -218,6 +218,10 @@ rip_output(struct mbuf *m, ...) m_freem(m); return (EMSGSIZE); } + if (m->m_pkthdr.len < sizeof (struct ip)) { + m_freem(m); + return (EINVAL); + } ip = mtod(m, struct ip *); NTOHS(ip->ip_len); NTOHS(ip->ip_off); |
