ssl/t1_lib.c:3984: error: NULL_DEREFERENCE
  pointer `cpk` last assigned on line 3983 could be null and is dereferenced at line 3984, column 45.
Showing all 30 steps of the trace


ssl/t1_lib.c:3972:1: start of procedure ssl_get_auto_dh()
3970.   
3971.   #ifndef OPENSSL_NO_DH
3972. > DH *ssl_get_auto_dh(SSL *s)
3973.   {
3974.       int dh_secbits = 80;

ssl/t1_lib.c:3974:5: 
3972.   DH *ssl_get_auto_dh(SSL *s)
3973.   {
3974. >     int dh_secbits = 80;
3975.       if (s->cert->dh_tmp_auto == 2)
3976.           return DH_get_1024_160();

ssl/t1_lib.c:3975:9: Taking false branch
3973.   {
3974.       int dh_secbits = 80;
3975.       if (s->cert->dh_tmp_auto == 2)
                ^
3976.           return DH_get_1024_160();
3977.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {

ssl/t1_lib.c:3977:9: Taking false branch
3975.       if (s->cert->dh_tmp_auto == 2)
3976.           return DH_get_1024_160();
3977.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
                ^
3978.           if (s->s3->tmp.new_cipher->strength_bits == 256)
3979.               dh_secbits = 128;

ssl/t1_lib.c:3983:9: 
3981.               dh_secbits = 80;
3982.       } else {
3983. >         CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
3984.           dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
3985.       }

ssl/ssl_lib.c:2706:1: start of procedure ssl_get_server_send_pkey()
  2704.   }
  2705.   
  2706. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
  2707.   {
  2708.       CERT *c;

ssl/ssl_lib.c:2711:5: 
  2709.       int i;
  2710.   
  2711. >     c = s->cert;
  2712.       if (!s->s3 || !s->s3->tmp.new_cipher)
  2713.           return NULL;

ssl/ssl_lib.c:2712:10: Taking false branch
  2710.   
  2711.       c = s->cert;
  2712.       if (!s->s3 || !s->s3->tmp.new_cipher)
                   ^
  2713.           return NULL;
  2714.       ssl_set_masks(s);

ssl/ssl_lib.c:2712:20: Taking false branch
  2710.   
  2711.       c = s->cert;
  2712.       if (!s->s3 || !s->s3->tmp.new_cipher)
                             ^
  2713.           return NULL;
  2714.       ssl_set_masks(s);

ssl/ssl_lib.c:2714:5: Skipping ssl_set_masks(): empty list of specs
  2712.       if (!s->s3 || !s->s3->tmp.new_cipher)
  2713.           return NULL;
  2714.       ssl_set_masks(s);
              ^
  2715.   
  2716.       i = ssl_get_server_cert_index(s);

ssl/ssl_lib.c:2716:5: 
  2714.       ssl_set_masks(s);
  2715.   
  2716. >     i = ssl_get_server_cert_index(s);
  2717.   
  2718.       /* This may or may not be an error. */

ssl/ssl_lib.c:2685:1: start of procedure ssl_get_server_cert_index()
    2683.   #endif
    2684.   
    2685. > static int ssl_get_server_cert_index(const SSL *s)
    2686.   {
    2687.       int idx;

ssl/ssl_lib.c:2688:5: 
    2686.   {
    2687.       int idx;
    2688. >     idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
    2689.       if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
    2690.           idx = SSL_PKEY_RSA_SIGN;

ssl/ssl_ciph.c:1880:1: start of procedure ssl_cipher_get_cert_index()
      1878.   
      1879.   /* For a cipher return the index corresponding to the certificate type */
      1880. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c)
      1881.   {
      1882.       uint32_t alg_a;

ssl/ssl_ciph.c:1884:5: 
      1882.       uint32_t alg_a;
      1883.   
      1884. >     alg_a = c->algorithm_auth;
      1885.   
      1886.       if (alg_a & SSL_aECDSA)

ssl/ssl_ciph.c:1886:9: Taking false branch
      1884.       alg_a = c->algorithm_auth;
      1885.   
      1886.       if (alg_a & SSL_aECDSA)
                      ^
      1887.           return SSL_PKEY_ECC;
      1888.       else if (alg_a & SSL_aDSS)

ssl/ssl_ciph.c:1888:14: Taking false branch
      1886.       if (alg_a & SSL_aECDSA)
      1887.           return SSL_PKEY_ECC;
      1888.       else if (alg_a & SSL_aDSS)
                           ^
      1889.           return SSL_PKEY_DSA_SIGN;
      1890.       else if (alg_a & SSL_aRSA)

ssl/ssl_ciph.c:1890:14: Taking true branch
      1888.       else if (alg_a & SSL_aDSS)
      1889.           return SSL_PKEY_DSA_SIGN;
      1890.       else if (alg_a & SSL_aRSA)
                           ^
      1891.           return SSL_PKEY_RSA_ENC;
      1892.       else if (alg_a & SSL_aGOST12)

ssl/ssl_ciph.c:1891:9: 
      1889.           return SSL_PKEY_DSA_SIGN;
      1890.       else if (alg_a & SSL_aRSA)
      1891. >         return SSL_PKEY_RSA_ENC;
      1892.       else if (alg_a & SSL_aGOST12)
      1893.           return SSL_PKEY_GOST_EC;

ssl/ssl_ciph.c:1898:1: return from a call to ssl_cipher_get_cert_index
      1896.   
      1897.       return -1;
      1898. > }
      1899.   
      1900.   const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr)

ssl/ssl_lib.c:2689:9: Taking true branch
    2687.       int idx;
    2688.       idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
    2689.       if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
                    ^
    2690.           idx = SSL_PKEY_RSA_SIGN;
    2691.       if (idx == SSL_PKEY_GOST_EC) {

ssl/ssl_lib.c:2689:37: Taking false branch
    2687.       int idx;
    2688.       idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
    2689.       if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
                                                ^
    2690.           idx = SSL_PKEY_RSA_SIGN;
    2691.       if (idx == SSL_PKEY_GOST_EC) {

ssl/ssl_lib.c:2691:9: Taking false branch
    2689.       if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
    2690.           idx = SSL_PKEY_RSA_SIGN;
    2691.       if (idx == SSL_PKEY_GOST_EC) {
                    ^
    2692.           if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509)
    2693.               idx = SSL_PKEY_GOST12_512;

ssl/ssl_lib.c:2701:9: Taking false branch
    2699.               idx = -1;
    2700.       }
    2701.       if (idx == -1)
                    ^
    2702.           SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
    2703.       return idx;

ssl/ssl_lib.c:2703:5: 
    2701.       if (idx == -1)
    2702.           SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
    2703. >     return idx;
    2704.   }
    2705.   

ssl/ssl_lib.c:2704:1: return from a call to ssl_get_server_cert_index
    2702.           SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
    2703.       return idx;
    2704. > }
    2705.   
    2706.   CERT_PKEY *ssl_get_server_send_pkey(SSL *s)

ssl/ssl_lib.c:2719:9: Taking true branch
  2717.   
  2718.       /* This may or may not be an error. */
  2719.       if (i < 0)
                  ^
  2720.           return NULL;
  2721.   

ssl/ssl_lib.c:2720:9: 
  2718.       /* This may or may not be an error. */
  2719.       if (i < 0)
  2720. >         return NULL;
  2721.   
  2722.       /* May be NULL. */

ssl/ssl_lib.c:2724:1: return from a call to ssl_get_server_send_pkey
  2722.       /* May be NULL. */
  2723.       return &c->pkeys[i];
  2724. > }
  2725.   
  2726.   EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,

ssl/t1_lib.c:3984:9: 
3982.       } else {
3983.           CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
3984. >         dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
3985.       }
3986.   
