summaryrefslogtreecommitdiffstats
path: root/crypto/lhash
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-04-18 16:33:21 +0200
committerRichard Levitte <levitte@openssl.org>2019-04-19 10:24:16 +0200
commitbcb5d42171386709c716312b711a0c15aa368f3f (patch)
tree2390f4df3acce18d58038ee4503af15bf78362f8 /crypto/lhash
parente019da7b6ff54822e307daf804f7fe78ec352457 (diff)
OPENSSL_LH_flush(): assign NULL after freeing
OPENSSL_LH_flush() frees the linked lists for each slot, but didn't set the list head to NULL after doing so, with the result that an operation that affects these lists is likely to cause a crash. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8781)
Diffstat (limited to 'crypto/lhash')
-rw-r--r--crypto/lhash/lhash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c
index aa0ca1c957..e3c7ac456b 100644
--- a/crypto/lhash/lhash.c
+++ b/crypto/lhash/lhash.c
@@ -98,6 +98,7 @@ void OPENSSL_LH_flush(OPENSSL_LHASH *lh)
OPENSSL_free(n);
n = nn;
}
+ lh->b[i] = NULL;
}
}