crypto/evp/pkey_mac.c:288: error: NULL_DEREFERENCE
  pointer `ciphname` last assigned on line 276 could be null and is dereferenced by call to `strlen()` at line 288, column 54.
Showing all 39 steps of the trace


crypto/evp/pkey_mac.c:262:1: start of procedure pkey_mac_ctrl()
260.   }
261.   
262. > static int pkey_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
263.   {
264.       MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);

crypto/evp/pkey_mac.c:264:5: 
262.   static int pkey_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
263.   {
264. >     MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
265.   
266.       switch (type) {

crypto/evp/pmeth_lib.c:576:1: start of procedure EVP_PKEY_CTX_get_data()
  574.   }
  575.   
  576. > void *EVP_PKEY_CTX_get_data(const EVP_PKEY_CTX *ctx)
  577.   {
  578.       return ctx->data;

crypto/evp/pmeth_lib.c:578:5: 
  576.   void *EVP_PKEY_CTX_get_data(const EVP_PKEY_CTX *ctx)
  577.   {
  578. >     return ctx->data;
  579.   }
  580.   

crypto/evp/pmeth_lib.c:579:1: return from a call to EVP_PKEY_CTX_get_data
  577.   {
  578.       return ctx->data;
  579. > }
  580.   
  581.   EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx)

crypto/evp/pkey_mac.c:266:5: 
264.       MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
265.   
266. >     switch (type) {
267.   
268.       case EVP_PKEY_CTRL_CIPHER:

crypto/evp/pkey_mac.c:268:5: Switch condition is true. Entering switch case
266.       switch (type) {
267.   
268.       case EVP_PKEY_CTRL_CIPHER:
           ^
269.           switch (hctx->type) {
270.           case MAC_TYPE_RAW:

crypto/evp/pkey_mac.c:269:9: 
267.   
268.       case EVP_PKEY_CTRL_CIPHER:
269. >         switch (hctx->type) {
270.           case MAC_TYPE_RAW:
271.               return -2;       /* The raw types don't support ciphers */

crypto/evp/pkey_mac.c:270:9: Switch condition is false. Skipping switch case
268.       case EVP_PKEY_CTRL_CIPHER:
269.           switch (hctx->type) {
270.           case MAC_TYPE_RAW:
               ^
271.               return -2;       /* The raw types don't support ciphers */
272.           case MAC_TYPE_MAC:

crypto/evp/pkey_mac.c:272:9: Switch condition is true. Entering switch case
270.           case MAC_TYPE_RAW:
271.               return -2;       /* The raw types don't support ciphers */
272.           case MAC_TYPE_MAC:
               ^
273.               {
274.                   OSSL_PARAM params[3];

crypto/evp/pkey_mac.c:275:17: 
273.               {
274.                   OSSL_PARAM params[3];
275. >                 size_t params_n = 0;
276.                   char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2));
277.   #ifndef OPENSSL_NO_ENGINE

crypto/evp/pkey_mac.c:276:17: 
274.                   OSSL_PARAM params[3];
275.                   size_t params_n = 0;
276. >                 char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2));
277.   #ifndef OPENSSL_NO_ENGINE
278.                   char *engineid = (char *)ENGINE_get_id(ctx->engine);

crypto/evp/evp_lib.c:423:1: start of procedure EVP_CIPHER_nid()
  421.   }
  422.   
  423. > int EVP_CIPHER_nid(const EVP_CIPHER *cipher)
  424.   {
  425.       return cipher->nid;

crypto/evp/evp_lib.c:425:5: 
  423.   int EVP_CIPHER_nid(const EVP_CIPHER *cipher)
  424.   {
  425. >     return cipher->nid;
  426.   }
  427.   

crypto/evp/evp_lib.c:426:1: return from a call to EVP_CIPHER_nid
  424.   {
  425.       return cipher->nid;
  426. > }
  427.   
  428.   int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx)

crypto/objects/obj_dat.c:250:1: start of procedure OBJ_nid2sn()
  248.   }
  249.   
  250. > const char *OBJ_nid2sn(int n)
  251.   {
  252.       ADDED_OBJ ad, *adp;

crypto/objects/obj_dat.c:255:10: Taking true branch
  253.       ASN1_OBJECT ob;
  254.   
  255.       if ((n >= 0) && (n < NUM_NID)) {
                  ^
  256.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
  257.               OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:255:22: Taking false branch
  253.       ASN1_OBJECT ob;
  254.   
  255.       if ((n >= 0) && (n < NUM_NID)) {
                              ^
  256.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
  257.               OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:264:5: Skipping OPENSSL_init_crypto(): empty list of specs
  262.   
  263.       /* Make sure we've loaded config before checking for any "added" objects */
  264.       OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
             ^
  265.   
  266.       if (added == NULL)

crypto/objects/obj_dat.c:266:9: Taking true branch
  264.       OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  265.   
  266.       if (added == NULL)
                 ^
  267.           return NULL;
  268.   

crypto/objects/obj_dat.c:267:9: 
  265.   
  266.       if (added == NULL)
  267. >         return NULL;
  268.   
  269.       ad.type = ADDED_NID;

crypto/objects/obj_dat.c:278:1: return from a call to OBJ_nid2sn
  276.       OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
  277.       return NULL;
  278. > }
  279.   
  280.   const char *OBJ_nid2ln(int n)

crypto/evp/pkey_mac.c:278:17: 
276.                   char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2));
277.   #ifndef OPENSSL_NO_ENGINE
278. >                 char *engineid = (char *)ENGINE_get_id(ctx->engine);
279.   
280.                   params[params_n++] =

crypto/engine/eng_lib.c:249:1: start of procedure ENGINE_get_id()
  247.   }
  248.   
  249. > const char *ENGINE_get_id(const ENGINE *e)
  250.   {
  251.       return e->id;

crypto/engine/eng_lib.c:251:5: 
  249.   const char *ENGINE_get_id(const ENGINE *e)
  250.   {
  251. >     return e->id;
  252.   }
  253.   

crypto/engine/eng_lib.c:252:1: return from a call to ENGINE_get_id
  250.   {
  251.       return e->id;
  252. > }
  253.   
  254.   const char *ENGINE_get_name(const ENGINE *e)

crypto/evp/pkey_mac.c:280:17: 
278.                   char *engineid = (char *)ENGINE_get_id(ctx->engine);
279.   
280. >                 params[params_n++] =
281.                       OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ENGINE,
282.                                                        engineid,

crypto/params.c:808:1: start of procedure OSSL_PARAM_construct_utf8_string()
  806.   }
  807.   
  808. > OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf,
  809.                                               size_t bsize)
  810.   {

crypto/params.c:811:5: 
  809.                                               size_t bsize)
  810.   {
  811. >     return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  812.   }
  813.   

crypto/params.c:30:1: start of procedure ossl_param_construct()
    28.   }
    29.   
    30. > static OSSL_PARAM ossl_param_construct(const char *key, unsigned int data_type,
    31.                                          void *data, size_t data_size)
    32.   {

crypto/params.c:35:5: 
    33.       OSSL_PARAM res;
    34.   
    35. >     res.key = key;
    36.       res.data_type = data_type;
    37.       res.data = data;

crypto/params.c:36:5: 
    34.   
    35.       res.key = key;
    36. >     res.data_type = data_type;
    37.       res.data = data;
    38.       res.data_size = data_size;

crypto/params.c:37:5: 
    35.       res.key = key;
    36.       res.data_type = data_type;
    37. >     res.data = data;
    38.       res.data_size = data_size;
    39.       res.return_size = 0;

crypto/params.c:38:5: 
    36.       res.data_type = data_type;
    37.       res.data = data;
    38. >     res.data_size = data_size;
    39.       res.return_size = 0;
    40.       return res;

crypto/params.c:39:5: 
    37.       res.data = data;
    38.       res.data_size = data_size;
    39. >     res.return_size = 0;
    40.       return res;
    41.   }

crypto/params.c:40:5: 
    38.       res.data_size = data_size;
    39.       res.return_size = 0;
    40. >     return res;
    41.   }
    42.   

crypto/params.c:41:1: return from a call to ossl_param_construct
    39.       res.return_size = 0;
    40.       return res;
    41. > }
    42.   
    43.   int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val)

crypto/params.c:812:1: return from a call to OSSL_PARAM_construct_utf8_string
  810.   {
  811.       return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  812. > }
  813.   
  814.   OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf,

crypto/evp/pkey_mac.c:285:17: 
283.                                                        strlen(engineid) + 1);
284.   #endif
285. >                 params[params_n++] =
286.                       OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER,
287.                                                        ciphname,
