]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
fuzz/hashtable.c: rc == -1 on insert is OK when fuzzing
authorTomas Mraz <tomas@openssl.org>
Thu, 22 Aug 2024 12:49:05 +0000 (14:49 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 22 Aug 2024 12:52:43 +0000 (14:52 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25273)

fuzz/hashtable.c

index b131d16bcc1a8512221aa0132f5657ed131122cd..38d22950763e5cd850d54c81d7c83d68b5a078ba 100644 (file)
@@ -188,6 +188,10 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
             rc = ossl_ht_fz_FUZZER_VALUE_insert(fuzzer_table, TO_HT_KEY(&key),
                                                 valptr, NULL);
 
+        if (rc == -1)
+            /* failed to grow the hash table due to too many collisions */
+            break;
+
         /*
          * mark the entry as being allocated
          */