Coverity 1453627: Null pointer dereferences (REVERSE_INULL)
authorPauli <paul.dale@oracle.com>
Sun, 8 Sep 2019 08:28:56 +0000 (18:28 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 10 Sep 2019 22:27:26 +0000 (08:27 +1000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9805)

ssl/t1_enc.c

index 4419d3f10b8300290d2e3f8516f5f021074e05b3..6726d8fb7d3caacc2d0bbbe332c046f056776d25 100644 (file)
@@ -35,7 +35,7 @@ static int tls1_PRF(SSL *s,
     EVP_KDF *kdf;
     EVP_KDF_CTX *kctx = NULL;
     OSSL_PARAM params[8], *p = params;
-    const char *mdname = EVP_MD_name(md);
+    const char *mdname;
 
     if (md == NULL) {
         /* Should never happen */
@@ -53,6 +53,7 @@ static int tls1_PRF(SSL *s,
     EVP_KDF_free(kdf);
     if (kctx == NULL)
         goto err;
+    mdname = EVP_MD_name(md);
     *p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
                                             (char *)mdname, strlen(mdname) + 1);
     *p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SECRET,