]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Check that sk_SSL_CIPHER_value returns non-NULL value.
authorDaniel Fiala <daniel@openssl.org>
Sun, 18 Sep 2022 05:36:36 +0000 (07:36 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 20 Sep 2022 16:27:17 +0000 (18:27 +0200)
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)

apps/ciphers.c

index fa119c6eb3baad6d4c17c3db85df4e4044a65976..c33685d8ced6d7146647612e657936f643778590 100644 (file)
@@ -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);