summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/raw_ip.c6
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);