apps/s_cb.c:415: error: NULL_DEREFERENCE
  pointer `ec` last assigned on line 412 could be null and is dereferenced by call to `EC_KEY_get0_group()` at line 415, column 43.
Showing all 37 steps of the trace


apps/s_cb.c:394:1: start of procedure ssl_print_tmp_key()
392.   #endif
393.   
394. > int ssl_print_tmp_key(BIO *out, SSL *s)
395.   {
396.       EVP_PKEY *key;

apps/s_cb.c:398:10: Taking false branch
396.       EVP_PKEY *key;
397.   
398.       if (!SSL_get_peer_tmp_key(s, &key))
                ^
399.           return 1;
400.       BIO_puts(out, "Server Temp Key: ");

apps/s_cb.c:400:5: 
398.       if (!SSL_get_peer_tmp_key(s, &key))
399.           return 1;
400. >     BIO_puts(out, "Server Temp Key: ");
401.       switch (EVP_PKEY_id(key)) {
402.       case EVP_PKEY_RSA:

crypto/bio/bio_lib.c:387:1: start of procedure BIO_puts()
  385.   }
  386.   
  387. > int BIO_puts(BIO *b, const char *buf)
  388.   {
  389.       int ret;

crypto/bio/bio_lib.c:390:5: 
  388.   {
  389.       int ret;
  390. >     size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {

crypto/bio/bio_lib.c:392:10: Taking false branch
  390.       size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
                  ^
  393.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD);
  394.           return -2;

crypto/bio/bio_lib.c:392:25: Taking false branch
  390.       size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
                                 ^
  393.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD);
  394.           return -2;

crypto/bio/bio_lib.c:392:48: Taking false branch
  390.       size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
                                                        ^
  393.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD);
  394.           return -2;

crypto/bio/bio_lib.c:397:9: Taking false branch
  395.       }
  396.   
  397.       if (b->callback != NULL || b->callback_ex != NULL) {
                 ^
  398.           ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  399.           if (ret <= 0)

crypto/bio/bio_lib.c:397:32: Taking false branch
  395.       }
  396.   
  397.       if (b->callback != NULL || b->callback_ex != NULL) {
                                        ^
  398.           ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  399.           if (ret <= 0)

crypto/bio/bio_lib.c:403:10: Taking true branch
  401.       }
  402.   
  403.       if (!b->init) {
                  ^
  404.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNINITIALIZED);
  405.           return -2;

crypto/bio/bio_lib.c:404:9: 
  402.   
  403.       if (!b->init) {
  404. >         BIOerr(BIO_F_BIO_PUTS, BIO_R_UNINITIALIZED);
  405.           return -2;
  406.       }

providers/fips/fipsprov.c:193:1: start of procedure ERR_put_error()
    191.   }
    192.   
    193. > void ERR_put_error(int lib, int func, int reason, const char *file, int line)
    194.   {
    195.       /*

providers/fips/fipsprov.c:201:5: Skipping __function_pointer__(): unresolved function pointer
    199.        * so we'll need to come up with something else for them.
    200.        */
    201.       c_put_error(lib, func, reason, file, line);
               ^
    202.   }
    203.   

providers/fips/fipsprov.c:202:1: return from a call to ERR_put_error
    200.        */
    201.       c_put_error(lib, func, reason, file, line);
    202. > }
    203.   
    204.   void ERR_add_error_data(int num, ...)

crypto/bio/bio_lib.c:405:9: 
  403.       if (!b->init) {
  404.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNINITIALIZED);
  405. >         return -2;
  406.       }
  407.   

crypto/bio/bio_lib.c:430:1: return from a call to BIO_puts
  428.   
  429.       return ret;
  430. > }
  431.   
  432.   int BIO_gets(BIO *b, char *buf, int size)

apps/s_cb.c:401:5: 
399.           return 1;
400.       BIO_puts(out, "Server Temp Key: ");
401. >     switch (EVP_PKEY_id(key)) {
402.       case EVP_PKEY_RSA:
403.           BIO_printf(out, "RSA, %d bits\n", EVP_PKEY_bits(key));

crypto/evp/p_lib.c:585:1: start of procedure EVP_PKEY_id()
  583.   }
  584.   
  585. > int EVP_PKEY_id(const EVP_PKEY *pkey)
  586.   {
  587.       return pkey->type;

crypto/evp/p_lib.c:587:5: 
  585.   int EVP_PKEY_id(const EVP_PKEY *pkey)
  586.   {
  587. >     return pkey->type;
  588.   }
  589.   

crypto/evp/p_lib.c:588:1: return from a call to EVP_PKEY_id
  586.   {
  587.       return pkey->type;
  588. > }
  589.   
  590.   int EVP_PKEY_base_id(const EVP_PKEY *pkey)

apps/s_cb.c:402:5: Switch condition is false. Skipping switch case
400.       BIO_puts(out, "Server Temp Key: ");
401.       switch (EVP_PKEY_id(key)) {
402.       case EVP_PKEY_RSA:
           ^
403.           BIO_printf(out, "RSA, %d bits\n", EVP_PKEY_bits(key));
404.           break;

apps/s_cb.c:406:5: Switch condition is false. Skipping switch case
404.           break;
405.   
406.       case EVP_PKEY_DH:
           ^
407.           BIO_printf(out, "DH, %d bits\n", EVP_PKEY_bits(key));
408.           break;

apps/s_cb.c:410:5: Switch condition is true. Entering switch case
408.           break;
409.   #ifndef OPENSSL_NO_EC
410.       case EVP_PKEY_EC:
           ^
411.           {
412.               EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);

apps/s_cb.c:412:13: 
410.       case EVP_PKEY_EC:
411.           {
412. >             EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key);
413.               int nid;
414.               const char *cname;

crypto/evp/p_lib.c:532:1: start of procedure EVP_PKEY_get1_EC_KEY()
  530.   }
  531.   
  532. > EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  533.   {
  534.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);

crypto/evp/p_lib.c:534:5: 
  532.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)
  533.   {
  534. >     EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  535.       if (ret != NULL)
  536.           EC_KEY_up_ref(ret);

crypto/evp/p_lib.c:523:1: start of procedure EVP_PKEY_get0_EC_KEY()
    521.   }
    522.   
    523. > EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey)
    524.   {
    525.       if (pkey->type != EVP_PKEY_EC) {

crypto/evp/p_lib.c:525:9: Taking false branch
    523.   EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey)
    524.   {
    525.       if (pkey->type != EVP_PKEY_EC) {
                   ^
    526.           EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY);
    527.           return NULL;

crypto/evp/p_lib.c:529:5: 
    527.           return NULL;
    528.       }
    529. >     return pkey->pkey.ec;
    530.   }
    531.   

crypto/evp/p_lib.c:530:1: return from a call to EVP_PKEY_get0_EC_KEY
    528.       }
    529.       return pkey->pkey.ec;
    530. > }
    531.   
    532.   EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey)

crypto/evp/p_lib.c:535:9: Taking false branch
  533.   {
  534.       EC_KEY *ret = EVP_PKEY_get0_EC_KEY(pkey);
  535.       if (ret != NULL)
                 ^
  536.           EC_KEY_up_ref(ret);
  537.       return ret;

crypto/evp/p_lib.c:537:5: 
  535.       if (ret != NULL)
  536.           EC_KEY_up_ref(ret);
  537. >     return ret;
  538.   }
  539.   #endif

crypto/evp/p_lib.c:538:1: return from a call to EVP_PKEY_get1_EC_KEY
  536.           EC_KEY_up_ref(ret);
  537.       return ret;
  538. > }
  539.   #endif
  540.   

apps/s_cb.c:415:13: 
413.               int nid;
414.               const char *cname;
415. >             nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec));
416.               EC_KEY_free(ec);
417.               cname = EC_curve_nid2nist(nid);

crypto/ec/ec_key.c:494:1: start of procedure EC_KEY_get0_group()
  492.   }
  493.   
  494. > const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  495.   {
  496.       return key->group;

crypto/ec/ec_key.c:496:5: 
  494.   const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
  495.   {
  496. >     return key->group;
  497.   }
  498.   
