]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - ssl/ssl_ciph.c
Don't send ciphersuites twice in QUIC
[thirdparty/openssl.git] / ssl / ssl_ciph.c
index 8c805fbfcfe365537ddf095f5703308b2010c528..0ea998d38329d9f6a2705cb5bc9e558bf4628368 100644 (file)
@@ -1495,9 +1495,11 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_CTX *ctx,
      */
     num_of_ciphers = ssl_method->num_ciphers();
 
-    co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers);
-    if (co_list == NULL)
-        return NULL;          /* Failure */
+    if (num_of_ciphers > 0) {
+        co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers);
+        if (co_list == NULL)
+            return NULL;          /* Failure */
+    }
 
     ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers,
                                disabled_mkey, disabled_auth, disabled_enc,