summaryrefslogtreecommitdiff
path: root/sys/netinet/ipsec_output.c
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2018-09-14 23:40:11 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2018-09-14 23:40:11 +0000
commitf74adbe5fb9a419a67818430acbbfd347d136da6 (patch)
tree323c3c78e6f1a7462db32d8ae8a6452128f473fb /sys/netinet/ipsec_output.c
parent877658b9f1e65312d2ce472d866532275894d17f (diff)
Initialize the TDB to NULL in ipsec_common_input() and
ipsec_{input,output}_cb() so that in the case of sending or receiving a bogus mbuf (NULL) we don't end up trying to dereference the TDB, while being an uninitialized pointer, to increase the drops. Coverity IDs 1473312, 1473313 and 1473317. OK mpi@ visa@
Diffstat (limited to 'sys/netinet/ipsec_output.c')
-rw-r--r--sys/netinet/ipsec_output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c
index c477793a01f..28ff5b92781 100644
--- a/sys/netinet/ipsec_output.c
+++ b/sys/netinet/ipsec_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_output.c,v 1.74 2018/08/28 15:15:02 mpi Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.75 2018/09/14 23:40:10 mestre Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -388,7 +388,7 @@ ipsec_output_cb(struct cryptop *crp)
{
struct tdb_crypto *tc = (struct tdb_crypto *) crp->crp_opaque;
struct mbuf *m = (struct mbuf *) crp->crp_buf;
- struct tdb *tdb;
+ struct tdb *tdb = NULL;
int error, ilen, olen;
if (m == NULL) {