]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Check SSL_set1_chain error in set_cert_cb
authorpanda <daniel.phan36@gmail.com>
Mon, 8 Mar 2021 21:12:42 +0000 (13:12 -0800)
committerTomas Mraz <tomas@openssl.org>
Thu, 11 Mar 2021 09:24:58 +0000 (10:24 +0100)
CLA: trivial

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14469)

apps/lib/s_cb.c

index 6737eca13e1abc5cc0717e899c358d41cac551e3..0ca90387385d249fa4a6bf95e66e31800aef6b61 100644 (file)
@@ -952,7 +952,8 @@ static int set_cert_cb(SSL *ssl, void *arg)
                 if (!SSL_build_cert_chain(ssl, 0))
                     return 0;
             } else if (exc->chain != NULL) {
-                SSL_set1_chain(ssl, exc->chain);
+                if (!SSL_set1_chain(ssl, exc->chain))
+                    return 0;
             }
         }
         exc = exc->prev;