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:580:1: start of procedure EVP_PKEY_id()
  578.   }
  579.   
  580. > int EVP_PKEY_id(const EVP_PKEY *pkey)
  581.   {
  582.       return pkey->type;

crypto/evp/p_lib.c:582:5: 
  580.   int EVP_PKEY_id(const EVP_PKEY *pkey)
  581.   {
  582. >     return pkey->type;
  583.   }
  584.   

crypto/evp/p_lib.c:583:1: return from a call to EVP_PKEY_id
  581.   {
  582.       return pkey->type;
  583. > }
  584.   
  585.   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:527:1: start of procedure EVP_PKEY_get1_EC_KEY()
  525.   }
  526.   
  527. > EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  528.   {
  529.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);

crypto/evp/p_lib.c:529:5: 
  527.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  528.   {
  529. >     EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  530.       if (ret != NULL)
  531.           EC_KEY_up_ref(ret);

crypto/evp/p_lib.c:518:1: start of procedure EVP_PKEY_get0_EC_KEY()
    516.   }
    517.   
    518. > EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey)
    519.   {
    520.       if (pkey->type != EVP_PKEY_EC) {

crypto/evp/p_lib.c:520:9: Taking false branch
    518.   EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey)
    519.   {
    520.       if (pkey->type != EVP_PKEY_EC) {
                   ^
    521.           EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY);
    522.           return NULL;

crypto/evp/p_lib.c:524:5: 
    522.           return NULL;
    523.       }
    524. >     return pkey->pkey.ec;
    525.   }
    526.   

crypto/evp/p_lib.c:525:1: return from a call to EVP_PKEY_get0_EC_KEY
    523.       }
    524.       return pkey->pkey.ec;
    525. > }
    526.   
    527.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)

crypto/evp/p_lib.c:530:9: Taking false branch
  528.   {
  529.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  530.       if (ret != NULL)
                 ^
  531.           EC_KEY_up_ref(ret);
  532.       return ret;

crypto/evp/p_lib.c:532:5: 
  530.       if (ret != NULL)
  531.           EC_KEY_up_ref(ret);
  532. >     return ret;
  533.   }
  534.   #endif

crypto/evp/p_lib.c:533:1: return from a call to EVP_PKEY_get1_EC_KEY
  531.           EC_KEY_up_ref(ret);
  532.       return ret;
  533. > }
  534.   #endif
  535.   

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:398:1: start of procedure EC_KEY_get0_group()
  396.   }
  397.   
  398. > const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  399.   {
  400.       return key->group;

crypto/ec/ec_key.c:400:5: 
  398.   const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  399.   {
  400. >     return key->group;
  401.   }
  402.   
