From 7e56c626936f7070070cf989053dc0011a9bca9c Mon Sep 17 00:00:00 2001 From: Pauli Date: Sun, 8 Sep 2019 18:28:56 +1000 Subject: [PATCH] Coverity 1453627: Null pointer dereferences (REVERSE_INULL) Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9805) --- ssl/t1_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 4419d3f10b..6726d8fb7d 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -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, -- 2.39.2