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@
-/* $OpenBSD: ipsec_input.c,v 1.166 2018/08/28 15:15:02 mpi Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.167 2018/09/14 23:40:10 mestre Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
} while (0)
union sockaddr_union dst_address;
- struct tdb *tdbp;
+ struct tdb *tdbp = NULL;
struct ifnet *encif;
u_int32_t spi;
u_int16_t cpi;
{
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 clen, error;
if (m == NULL) {
-/* $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)
*
{
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) {