correct space check

Submitted by:	ume
This commit is contained in:
Sam Leffler 2005-03-09 15:28:48 +00:00
parent d34fd3c7e0
commit afa3570d6f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143323

View File

@ -669,7 +669,7 @@ ipsec4_get_ulp(struct mbuf *m, struct secpolicyindex *spidx, int needport)
spidx->dst.sin.sin_port = uh.uh_dport;
return;
case IPPROTO_AH:
if (m->m_pkthdr.len > off + sizeof(ip6e))
if (off + sizeof(ip6e) > m->m_pkthdr.len)
goto done;
/* XXX sigh, this works but is totally bogus */
m_copydata(m, off, sizeof(ip6e), (caddr_t) &ip6e);