diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-02-20 18:33:50 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-02-20 18:33:50 +0000 |
commit | 80c8b7992ae69c9dd7a4fb82ad2dda79bea1ea61 (patch) | |
tree | 4070c85efa73dbe1a79d6e67c388119d786a6f08 | |
parent | 0aa53e95c6ee06421ec20efacca20818320a21e0 (diff) |
If there's no tag to be reset, don't reset it (avoids a NULL deref in the IPCOMP case)
-rw-r--r-- | sys/netinet/ipsec_input.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c index cf6cacb6785..b268be7b0ab 100644 --- a/sys/netinet/ipsec_input.c +++ b/sys/netinet/ipsec_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_input.c,v 1.61 2002/06/28 19:07:03 angelos Exp $ */ +/* $OpenBSD: ipsec_input.c,v 1.62 2003/02/20 18:33:49 jason Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -503,9 +503,10 @@ ipsec_common_input_cb(struct mbuf *m, struct tdb *tdbp, int skip, int protoff, tdbi->spi = tdbp->tdb_spi; m_tag_prepend(m, mtag); + } else { + if (mt != NULL) + mt->m_tag_id = PACKET_TAG_IPSEC_IN_DONE; } - else - mt->m_tag_id = PACKET_TAG_IPSEC_IN_DONE; if (sproto == IPPROTO_ESP) { /* Packet is confidential ? */ |