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


test/ssltest.c:839:1: start of procedure print_key_details()
837.   }
838.   
839. > static void print_key_details(BIO *out, EVP_PKEY *key)
840.   {
841.       int keyid = EVP_PKEY_id(key);

test/ssltest.c:841:5: 
839.   static void print_key_details(BIO *out, EVP_PKEY *key)
840.   {
841. >     int keyid = EVP_PKEY_id(key);
842.   #ifndef OPENSSL_NO_EC
843.       if (keyid == EVP_PKEY_EC) {

crypto/evp/p_lib.c:410:1: start of procedure EVP_PKEY_id()
  408.   }
  409.   
  410. > int EVP_PKEY_id(const EVP_PKEY *pkey)
  411.   {
  412.       return pkey->type;

crypto/evp/p_lib.c:412:5: 
  410.   int EVP_PKEY_id(const EVP_PKEY *pkey)
  411.   {
  412. >     return pkey->type;
  413.   }
  414.   

crypto/evp/p_lib.c:413:1: return from a call to EVP_PKEY_id
  411.   {
  412.       return pkey->type;
  413. > }
  414.   
  415.   int EVP_PKEY_base_id(const EVP_PKEY *pkey)

test/ssltest.c:843:9: Taking true branch
841.       int keyid = EVP_PKEY_id(key);
842.   #ifndef OPENSSL_NO_EC
843.       if (keyid == EVP_PKEY_EC) {
               ^
844.           EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
845.           int nid;

test/ssltest.c:844:9: 
842.   #ifndef OPENSSL_NO_EC
843.       if (keyid == EVP_PKEY_EC) {
844. >         EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
845.           int nid;
846.           const char *cname;

crypto/evp/p_lib.c:356:1: start of procedure EVP_PKEY_get1_EC_KEY()
  354.   }
  355.   
  356. > EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  357.   {
  358.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);

crypto/evp/p_lib.c:358:5: 
  356.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  357.   {
  358. >     EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  359.       if (ret != NULL)
  360.           EC_KEY_up_ref(ret);

crypto/evp/p_lib.c:347:1: start of procedure EVP_PKEY_get0_EC_KEY()
    345.   }
    346.   
    347. > EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
    348.   {
    349.       if (pkey->type != EVP_PKEY_EC) {

crypto/evp/p_lib.c:349:9: Taking false branch
    347.   EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
    348.   {
    349.       if (pkey->type != EVP_PKEY_EC) {
                   ^
    350.           EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY);
    351.           return NULL;

crypto/evp/p_lib.c:353:5: 
    351.           return NULL;
    352.       }
    353. >     return pkey->pkey.ec;
    354.   }
    355.   

crypto/evp/p_lib.c:354:1: return from a call to EVP_PKEY_get0_EC_KEY
    352.       }
    353.       return pkey->pkey.ec;
    354. > }
    355.   
    356.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)

crypto/evp/p_lib.c:359:9: Taking false branch
  357.   {
  358.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  359.       if (ret != NULL)
                 ^
  360.           EC_KEY_up_ref(ret);
  361.       return ret;

crypto/evp/p_lib.c:361:5: 
  359.       if (ret != NULL)
  360.           EC_KEY_up_ref(ret);
  361. >     return ret;
  362.   }
  363.   #endif

crypto/evp/p_lib.c:362:1: return from a call to EVP_PKEY_get1_EC_KEY
  360.           EC_KEY_up_ref(ret);
  361.       return ret;
  362. > }
  363.   #endif
  364.   

test/ssltest.c:847:9: 
845.           int nid;
846.           const char *cname;
847. >         nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec));
848.           EC_KEY_free(ec);
849.           cname = EC_curve_nid2nist(nid);

crypto/ec/ec_key.c:439:1: start of procedure EC_KEY_get0_group()
  437.   }
  438.   
  439. > const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  440.   {
  441.       return key->group;

crypto/ec/ec_key.c:441:5: 
  439.   const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  440.   {
  441. >     return key->group;
  442.   }
  443.   
