diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-02-15 16:43:11 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-02-15 16:43:11 +0000 |
commit | 000955fd91aacfdc45088d919fac491667a6e1c8 (patch) | |
tree | 79fd48aac95e69657cd61d588838c0e4c7aac5e9 /sys/netinet/raw_ip.c | |
parent | 2f34d175b5693779c270bb4a071972f7028f8507 (diff) |
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); |