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 38 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 false branch
  401.       }
  402.   
  403.       if (!b->init) {
                  ^
  404.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNINITIALIZED);
  405.           return -2;

crypto/bio/bio_lib.c:408:5: Skipping __function_pointer__(): unresolved function pointer
  406.       }
  407.   
  408.       ret = b->method->bputs(b, buf);
             ^
  409.   
  410.       if (ret > 0) {

crypto/bio/bio_lib.c:410:9: Taking false branch
  408.       ret = b->method->bputs(b, buf);
  409.   
  410.       if (ret > 0) {
                 ^
  411.           b->num_write += (uint64_t)ret;
  412.           written = ret;

crypto/bio/bio_lib.c:416:9: Taking false branch
  414.       }
  415.   
  416.       if (b->callback != NULL || b->callback_ex != NULL)
                 ^
  417.           ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  418.                                        0L, ret, &written);

crypto/bio/bio_lib.c:416:32: Taking false branch
  414.       }
  415.   
  416.       if (b->callback != NULL || b->callback_ex != NULL)
                                        ^
  417.           ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  418.                                        0L, ret, &written);

crypto/bio/bio_lib.c:420:9: Taking false branch
  418.                                        0L, ret, &written);
  419.   
  420.       if (ret > 0) {
                 ^
  421.           if (written > INT_MAX) {
  422.               BIOerr(BIO_F_BIO_PUTS, BIO_R_LENGTH_TOO_LONG);

crypto/bio/bio_lib.c:429:5: 
  427.       }
  428.   
  429. >     return ret;
  430.   }
  431.   

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.   
