Fix bug in OPENSSL_LH_flush
authorHugo Landau <hlandau@openssl.org>
Thu, 21 Apr 2022 15:10:33 +0000 (16:10 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 25 Apr 2022 11:20:13 +0000 (13:20 +0200)
Fixes #18139.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18141)

(cherry picked from commit e5da68183410c06f7b350a0721bc2bd6057e438e)

crypto/lhash/lhash.c

index a15857cf9fd5ed2b460123e566f58dce2465fee2..1cd988f01fc76a59267281b459a0ca68efee0a8f 100644 (file)
@@ -100,6 +100,8 @@ void OPENSSL_LH_flush(OPENSSL_LHASH *lh)
         }
         lh->b[i] = NULL;
     }
+
+    lh->num_items = 0;
 }
 
 void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)