diff options
author | Sam Leffler <sam@FreeBSD.org> | 2005-03-09 15:28:48 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2005-03-09 15:28:48 +0000 |
commit | afa3570d6f618e1a7f4cb956a90be361bc9767ab (patch) | |
tree | 2a45f0fc3fe93de39ee04b9f92a82879d6e4c4fa | |
parent | d34fd3c7e0f376b7d3364c658139a1c46a63e582 (diff) | |
download | src-afa3570d6f618e1a7f4cb956a90be361bc9767ab.tar.gz src-afa3570d6f618e1a7f4cb956a90be361bc9767ab.zip |
correct space check
Submitted by: ume
Notes
Notes:
svn path=/head/; revision=143323
-rw-r--r-- | sys/netipsec/ipsec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c index 51b39ed02048..b2c31d0ce5ef 100644 --- a/sys/netipsec/ipsec.c +++ b/sys/netipsec/ipsec.c @@ -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); |