From 96754ab490713d112573dea1937460e93e78b737 Mon Sep 17 00:00:00 2001 From: Jun-ichiro itojun Hagino Date: Thu, 5 Jul 2001 23:41:35 +0000 Subject: IP6_EXTHDR_GET0 did not check m->m_len (noone was using this macro). sync with kame --- sys/netinet/ip6.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index c189cc9d5f3..c86728cdbc8 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6.h,v 1.7 2001/06/09 07:03:41 angelos Exp $ */ +/* $OpenBSD: ip6.h,v 1.8 2001/07/05 23:41:34 itojun Exp $ */ /* $KAME: ip6.h,v 1.14 2000/10/09 01:04:09 itojun Exp $ */ /* @@ -280,8 +280,8 @@ do { \ #define IP6_EXTHDR_GET0(val, typ, m, off, len) \ do { \ struct mbuf *t; \ - if ((off) == 0) \ - (val) = (typ)mtod(m, caddr_t); \ + if ((off) == 0 && (m)->m_len >= len) \ + (val) = (typ)mtod((m), caddr_t); \ else { \ t = m_pulldown((m), (off), (len), NULL); \ if (t) { \ -- cgit v1.2.3