From 27f8189d845779a37b008b2927d81faad3dd4c96 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 20 Apr 2021 22:34:23 +0200 Subject: accesslist checker should not operate on an empty list --- ot_accesslist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ot_accesslist.c b/ot_accesslist.c index 48de873..921bde3 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c @@ -116,7 +116,10 @@ int accesslist_hashisvalid( ot_hash hash ) { /* Get working copy of current access list */ ot_accesslist * accesslist = g_accesslist; - void * exactmatch = bsearch( hash, accesslist->list, accesslist->size, OT_HASH_COMPARE_SIZE, vector_compare_hash ); + void * exactmatch = NULL; + + if (accesslist) + bsearch( hash, accesslist->list, accesslist->size, OT_HASH_COMPARE_SIZE, vector_compare_hash ); #ifdef WANT_ACCESSLIST_BLACK return exactmatch == NULL; -- cgit v1.2.3