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


test/ssltest_old.c:803:1: start of procedure print_key_details()
801.   }
802.   
803. > static void print_key_details(BIO *out, EVP_PKEY *key)
804.   {
805.       int keyid = EVP_PKEY_id(key);

test/ssltest_old.c:805:5: 
803.   static void print_key_details(BIO *out, EVP_PKEY *key)
804.   {
805. >     int keyid = EVP_PKEY_id(key);
806.   #ifndef OPENSSL_NO_EC
807.       if (keyid == EVP_PKEY_EC) {

crypto/evp/p_lib.c:378:1: start of procedure EVP_PKEY_id()
  376.   }
  377.   
  378. > int EVP_PKEY_id(const EVP_PKEY *pkey)
  379.   {
  380.       return pkey->type;

crypto/evp/p_lib.c:380:5: 
  378.   int EVP_PKEY_id(const EVP_PKEY *pkey)
  379.   {
  380. >     return pkey->type;
  381.   }
  382.   

crypto/evp/p_lib.c:381:1: return from a call to EVP_PKEY_id
  379.   {
  380.       return pkey->type;
  381. > }
  382.   
  383.   int EVP_PKEY_base_id(const EVP_PKEY *pkey)

test/ssltest_old.c:807:9: Taking true branch
805.       int keyid = EVP_PKEY_id(key);
806.   #ifndef OPENSSL_NO_EC
807.       if (keyid == EVP_PKEY_EC) {
               ^
808.           EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
809.           int nid;

test/ssltest_old.c:808:9: 
806.   #ifndef OPENSSL_NO_EC
807.       if (keyid == EVP_PKEY_EC) {
808. >         EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
809.           int nid;
810.           const char *cname;

crypto/evp/p_lib.c:325:1: start of procedure EVP_PKEY_get1_EC_KEY()
  323.   }
  324.   
  325. > EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  326.   {
  327.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);

crypto/evp/p_lib.c:327:5: 
  325.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  326.   {
  327. >     EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  328.       if (ret != NULL)
  329.           EC_KEY_up_ref(ret);

crypto/evp/p_lib.c:316:1: start of procedure EVP_PKEY_get0_EC_KEY()
    314.   }
    315.   
    316. > EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
    317.   {
    318.       if (pkey->type != EVP_PKEY_EC) {

crypto/evp/p_lib.c:318:9: Taking false branch
    316.   EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
    317.   {
    318.       if (pkey->type != EVP_PKEY_EC) {
                   ^
    319.           EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY);
    320.           return NULL;

crypto/evp/p_lib.c:322:5: 
    320.           return NULL;
    321.       }
    322. >     return pkey->pkey.ec;
    323.   }
    324.   

crypto/evp/p_lib.c:323:1: return from a call to EVP_PKEY_get0_EC_KEY
    321.       }
    322.       return pkey->pkey.ec;
    323. > }
    324.   
    325.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)

crypto/evp/p_lib.c:328:9: Taking false branch
  326.   {
  327.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  328.       if (ret != NULL)
                 ^
  329.           EC_KEY_up_ref(ret);
  330.       return ret;

crypto/evp/p_lib.c:330:5: 
  328.       if (ret != NULL)
  329.           EC_KEY_up_ref(ret);
  330. >     return ret;
  331.   }
  332.   #endif

crypto/evp/p_lib.c:331:1: return from a call to EVP_PKEY_get1_EC_KEY
  329.           EC_KEY_up_ref(ret);
  330.       return ret;
  331. > }
  332.   #endif
  333.   

test/ssltest_old.c:811:9: 
809.           int nid;
810.           const char *cname;
811. >         nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec));
812.           EC_KEY_free(ec);
813.           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.   
