crypto/kdf/sskdf.c:227: error: NULL_DEREFERENCE
  pointer `mdname` last assigned on line 223 could be null and is dereferenced by call to `strlen()` at line 227, column 46.
Showing all 19 steps of the trace


crypto/kdf/sskdf.c:195:1: start of procedure SSKDF_mac_kdm()
193.    *     H(x) = KMAC#(salt, x, outbits, CustomString='KDF')
194.    */
195. > static int SSKDF_mac_kdm(EVP_MAC *kdf_mac, const EVP_MD *hmac_md,
196.                            const unsigned char *kmac_custom,
197.                            size_t kmac_custom_len, size_t kmac_out_len,

crypto/kdf/sskdf.c:203:5: 
201.                            unsigned char *derived_key, size_t derived_key_len)
202.   {
203. >     int ret = 0;
204.       size_t counter, out_len, len;
205.       unsigned char c[4];

crypto/kdf/sskdf.c:207:5: 
205.       unsigned char c[4];
206.       unsigned char mac_buf[EVP_MAX_MD_SIZE];
207. >     unsigned char *out = derived_key;
208.       EVP_MAC_CTX *ctx = NULL, *ctx_init = NULL;
209.       unsigned char *mac = mac_buf, *kmac_buffer = NULL;

crypto/kdf/sskdf.c:208:5: 
206.       unsigned char mac_buf[EVP_MAX_MD_SIZE];
207.       unsigned char *out = derived_key;
208. >     EVP_MAC_CTX *ctx = NULL, *ctx_init = NULL;
209.       unsigned char *mac = mac_buf, *kmac_buffer = NULL;
210.       OSSL_PARAM params[3];

crypto/kdf/sskdf.c:209:5: 
207.       unsigned char *out = derived_key;
208.       EVP_MAC_CTX *ctx = NULL, *ctx_init = NULL;
209. >     unsigned char *mac = mac_buf, *kmac_buffer = NULL;
210.       OSSL_PARAM params[3];
211.       size_t params_n = 0;

crypto/kdf/sskdf.c:211:5: 
209.       unsigned char *mac = mac_buf, *kmac_buffer = NULL;
210.       OSSL_PARAM params[3];
211. >     size_t params_n = 0;
212.   
213.       if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN

crypto/kdf/sskdf.c:213:9: Taking false branch
211.       size_t params_n = 0;
212.   
213.       if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN
               ^
214.               || derived_key_len > SSKDF_MAX_INLEN
215.               || derived_key_len == 0)

crypto/kdf/sskdf.c:213:36: Taking false branch
211.       size_t params_n = 0;
212.   
213.       if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN
                                          ^
214.               || derived_key_len > SSKDF_MAX_INLEN
215.               || derived_key_len == 0)

crypto/kdf/sskdf.c:214:16: Taking false branch
212.   
213.       if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN
214.               || derived_key_len > SSKDF_MAX_INLEN
                      ^
215.               || derived_key_len == 0)
216.           return 0;

crypto/kdf/sskdf.c:215:16: Taking false branch
213.       if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN
214.               || derived_key_len > SSKDF_MAX_INLEN
215.               || derived_key_len == 0)
                      ^
216.           return 0;
217.   

crypto/kdf/sskdf.c:218:5: Skipping EVP_MAC_CTX_new(): empty list of specs
216.           return 0;
217.   
218.       ctx_init = EVP_MAC_CTX_new(kdf_mac);
           ^
219.       if (ctx_init == NULL)
220.           goto end;

crypto/kdf/sskdf.c:219:9: Taking false branch
217.   
218.       ctx_init = EVP_MAC_CTX_new(kdf_mac);
219.       if (ctx_init == NULL)
               ^
220.           goto end;
221.   

crypto/kdf/sskdf.c:222:9: Taking true branch
220.           goto end;
221.   
222.       if (hmac_md != NULL) {
               ^
223.           const char *mdname = EVP_MD_name(hmac_md);
224.           params[params_n++] =

crypto/kdf/sskdf.c:223:9: 
221.   
222.       if (hmac_md != NULL) {
223. >         const char *mdname = EVP_MD_name(hmac_md);
224.           params[params_n++] =
225.               OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,

crypto/evp/evp_lib.c:460:1: start of procedure EVP_MD_name()
  458.   }
  459.   
  460. > const char *EVP_MD_name(const EVP_MD *md)
  461.   {
  462.       if (md->prov != NULL)

crypto/evp/evp_lib.c:462:9: Taking false branch
  460.   const char *EVP_MD_name(const EVP_MD *md)
  461.   {
  462.       if (md->prov != NULL)
                 ^
  463.           return md->name;
  464.   #ifndef FIPS_MODE

crypto/evp/evp_lib.c:467:5: 
  465.       return OBJ_nid2sn(EVP_MD_nid(md));
  466.   #else
  467. >     return NULL;
  468.   #endif
  469.   }

crypto/evp/evp_lib.c:469:1: return from a call to EVP_MD_name
  467.       return NULL;
  468.   #endif
  469. > }
  470.   
  471.   const OSSL_PROVIDER *EVP_MD_provider(const EVP_MD *md)

crypto/kdf/sskdf.c:224:9: 
222.       if (hmac_md != NULL) {
223.           const char *mdname = EVP_MD_name(hmac_md);
224. >         params[params_n++] =
225.               OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
226.                                                (char *)mdname,
