summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Fiala <daniel@openssl.org>2022-09-18 07:36:36 +0200
committerTomas Mraz <tomas@openssl.org>2022-09-20 18:27:53 +0200
commit67f58eaac17d16020da8503493dbbe77c80698f5 (patch)
treea4b6904458c82910b4475cc8e97858f8aff424f2 /apps
parent70f1b6aaa5de06a317c366b17edcbff890f062b2 (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) (cherry picked from commit 630d31219b343d2654ab03d2e2c7884e764936ab)
Diffstat (limited to 'apps')
-rw-r--r--apps/ciphers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/ciphers.c b/apps/ciphers.c
index 4dc3fa9454..42a0bb79f6 100644
--- a/apps/ciphers.c
+++ b/apps/ciphers.c
@@ -227,6 +227,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;
@@ -242,6 +246,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);