From 4d4b6ca21abb045b3f6584cc35a22ad4ab7a719a Mon Sep 17 00:00:00 2001 From: schwarze <> Date: Wed, 16 Sep 2020 07:25:15 +0000 Subject: Let SSL_CTX_get_ciphers(NULL) return NULL rather than crash for compatibility with OpenSSL and for consistency with neighbouring functions; suggested by jsing@ after i documented the crash; OK jsing@. --- src/lib/libssl/ssl_lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 828aa3a08d..73bc05e967 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.228 2020/09/15 11:47:49 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.229 2020/09/16 07:25:15 schwarze Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1336,6 +1336,8 @@ SSL_get_cipher_list(const SSL *s, int n) STACK_OF(SSL_CIPHER) * SSL_CTX_get_ciphers(const SSL_CTX *ctx) { + if (ctx == NULL) + return NULL; return ctx->cipher_list; } -- cgit v1.2.3-55-g6feb