summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-06-07 07:20:39 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-06-07 07:20:39 +0000
commit52bfdaa2df1127361147298167f12b3278773be6 (patch)
tree468c81727211bd964b6c976c50b540bcea4915b5 /sys/netinet/ip_ipsp.c
parent184f5b3edd634fae3b8558b4669ced57cb900d02 (diff)
Fix use of uninitialized TDB hash table in tdb_delete(), introduced
along with the dynamically-resized TDB table (report and fix suggestion by henric@ncal.verio.com)
Diffstat (limited to 'sys/netinet/ip_ipsp.c')
-rw-r--r--sys/netinet/ip_ipsp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 0fbfdc0c04d..17aee8d995a 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.45 1999/06/04 22:40:36 provos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.46 1999/06/07 07:20:38 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -146,7 +146,7 @@ struct xformsw *xformswNXFORMSW = &xformsw[sizeof(xformsw)/sizeof(xformsw[0])];
unsigned char ipseczeroes[IPSEC_ZEROES_SIZE]; /* zeroes! */
#define TDB_HASHSIZE_INIT 32
-static struct tdb **tdbh;
+static struct tdb **tdbh = NULL;
static u_int tdb_hashmask = TDB_HASHSIZE_INIT - 1;
/*
@@ -840,6 +840,9 @@ tdb_delete(struct tdb *tdbp, int delchain, int expflags)
u_int32_t hashval = tdbp->tdb_sproto + tdbp->tdb_spi, i;
int s;
+ if (tdbh == NULL)
+ return;
+
for (i = 0; i < SA_LEN(&tdbp->tdb_dst.sa); i++)
hashval += ptr[i];