diff options
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 61285a8a4a6..502eecd7ad8 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.62 2012/10/21 13:06:03 benno Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.63 2013/03/30 12:15:29 bluhm Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -419,6 +419,10 @@ rip_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, error = EACCES; break; } + if ((long)nam < 0 || (long)nam >= IPPROTO_MAX) { + error = EPROTONOSUPPORT; + break; + } if ((error = soreserve(so, rip_sendspace, rip_recvspace)) || (error = in_pcballoc(so, &rawcbtable))) break; |