]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
accesslist checker should not operate on an empty list
authorDirk Engling <erdgeist@erdgeist.org>
Tue, 20 Apr 2021 20:34:23 +0000 (22:34 +0200)
committerDirk Engling <erdgeist@erdgeist.org>
Tue, 20 Apr 2021 20:34:23 +0000 (22:34 +0200)
ot_accesslist.c

index 48de873d32ab3ada4de4e8cd739c1473a4d743d0..921bde32dd8fcd5cbf00484d7b53f55ebeccd4db 100644 (file)
@@ -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;