From: Todd Short Date: Wed, 4 Oct 2017 13:15:19 +0000 (-0400) Subject: Add sk_new_reserve support X-Git-Tag: OpenSSL_1_1_1-pre1~398 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e670e90319b902de528db0d22d7197b5de1f4891;p=oweals%2Fopenssl.git Add sk_new_reserve support This is a specific 1.1.1 change; do not squash if the chacha prioritization code is to be backported Reviewed-by: Paul Dale Reviewed-by: Tim Hudson Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/4436) --- diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index c063fff87a..e71373d2bf 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4173,7 +4173,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, } } if (found) { - prio_chacha = sk_SSL_CIPHER_new_null(); + prio_chacha = sk_SSL_CIPHER_new_reserve(NULL, num); /* if reserve fails, then there's likely a memory issue */ if (prio_chacha != NULL) { /* Put all ChaCha20 at the top, starting with the one we just found */