test/ssltest_old.c:732: error: NULL_DEREFERENCE
  pointer `ec` last assigned on line 729 could be null and is dereferenced by call to `EC_KEY_get0_group()` at line 732, column 39.
Showing all 19 steps of the trace


test/ssltest_old.c:724:1: start of procedure print_key_details()
722.   }
723.   
724. > static void print_key_details(BIO *out, EVP_PKEY *key)
725.   {
726.       int keyid = EVP_PKEY_id(key);

test/ssltest_old.c:726:5: 
724.   static void print_key_details(BIO *out, EVP_PKEY *key)
725.   {
726. >     int keyid = EVP_PKEY_id(key);
727.   #ifndef OPENSSL_NO_EC
728.       if (keyid == EVP_PKEY_EC) {

crypto/evp/p_lib.c:428:1: start of procedure EVP_PKEY_id()
  426.   }
  427.   
  428. > int EVP_PKEY_id(const EVP_PKEY *pkey)
  429.   {
  430.       return pkey->type;

crypto/evp/p_lib.c:430:5: 
  428.   int EVP_PKEY_id(const EVP_PKEY *pkey)
  429.   {
  430. >     return pkey->type;
  431.   }
  432.   

crypto/evp/p_lib.c:431:1: return from a call to EVP_PKEY_id
  429.   {
  430.       return pkey->type;
  431. > }
  432.   
  433.   int EVP_PKEY_base_id(const EVP_PKEY *pkey)

test/ssltest_old.c:728:9: Taking true branch
726.       int keyid = EVP_PKEY_id(key);
727.   #ifndef OPENSSL_NO_EC
728.       if (keyid == EVP_PKEY_EC) {
               ^
729.           EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
730.           int nid;

test/ssltest_old.c:729:9: 
727.   #ifndef OPENSSL_NO_EC
728.       if (keyid == EVP_PKEY_EC) {
729. >         EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
730.           int nid;
731.           const char *cname;

crypto/evp/p_lib.c:375:1: start of procedure EVP_PKEY_get1_EC_KEY()
  373.   }
  374.   
  375. > EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  376.   {
  377.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);

crypto/evp/p_lib.c:377:5: 
  375.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  376.   {
  377. >     EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  378.       if (ret != NULL)
  379.           EC_KEY_up_ref(ret);

crypto/evp/p_lib.c:366:1: start of procedure EVP_PKEY_get0_EC_KEY()
    364.   }
    365.   
    366. > EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
    367.   {
    368.       if (pkey->type != EVP_PKEY_EC) {

crypto/evp/p_lib.c:368:9: Taking false branch
    366.   EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
    367.   {
    368.       if (pkey->type != EVP_PKEY_EC) {
                   ^
    369.           EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY);
    370.           return NULL;

crypto/evp/p_lib.c:372:5: 
    370.           return NULL;
    371.       }
    372. >     return pkey->pkey.ec;
    373.   }
    374.   

crypto/evp/p_lib.c:373:1: return from a call to EVP_PKEY_get0_EC_KEY
    371.       }
    372.       return pkey->pkey.ec;
    373. > }
    374.   
    375.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)

crypto/evp/p_lib.c:378:9: Taking false branch
  376.   {
  377.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  378.       if (ret != NULL)
                 ^
  379.           EC_KEY_up_ref(ret);
  380.       return ret;

crypto/evp/p_lib.c:380:5: 
  378.       if (ret != NULL)
  379.           EC_KEY_up_ref(ret);
  380. >     return ret;
  381.   }
  382.   #endif

crypto/evp/p_lib.c:381:1: return from a call to EVP_PKEY_get1_EC_KEY
  379.           EC_KEY_up_ref(ret);
  380.       return ret;
  381. > }
  382.   #endif
  383.   

test/ssltest_old.c:732:9: 
730.           int nid;
731.           const char *cname;
732. >         nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec));
733.           EC_KEY_free(ec);
734.           cname = EC_curve_nid2nist(nid);

crypto/ec/ec_key.c:419:1: start of procedure EC_KEY_get0_group()
  417.   }
  418.   
  419. > const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  420.   {
  421.       return key->group;

crypto/ec/ec_key.c:421:5: 
  419.   const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  420.   {
  421. >     return key->group;
  422.   }
  423.   
