diff options
author | Daniel Fiala <daniel@openssl.org> | 2022-09-18 07:36:36 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-09-20 18:27:17 +0200 |
commit | 630d31219b343d2654ab03d2e2c7884e764936ab (patch) | |
tree | 5017216cd7d10d50a8cbe13d91952997258a8d5f | |
parent | 4689fe1bfd390db591ad5ab5479f06b52ac6f337 (diff) |
Check that sk_SSL_CIPHER_value returns non-NULL value.
Fixes openssl#19162.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19233)
-rw-r--r-- | apps/ciphers.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/ciphers.c b/apps/ciphers.c index fa119c6eb3..c33685d8ce 100644 --- a/apps/ciphers.c +++ b/apps/ciphers.c @@ -226,6 +226,10 @@ int ciphers_main(int argc, char **argv) if (!verbose) { for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) { const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, i); + + if (!ossl_assert(c != NULL)) + continue; + p = SSL_CIPHER_get_name(c); if (p == NULL) break; @@ -241,6 +245,9 @@ int ciphers_main(int argc, char **argv) c = sk_SSL_CIPHER_value(sk, i); + if (!ossl_assert(c != NULL)) + continue; + if (Verbose) { unsigned long id = SSL_CIPHER_get_id(c); int id0 = (int)(id >> 24); |