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


ssl/t1_lib.c:2151:1: start of procedure ssl_get_auto_dh()
2149.   
2150.   #ifndef OPENSSL_NO_DH
2151. > DH *ssl_get_auto_dh(SSL *s)
2152.   {
2153.       int dh_secbits = 80;

ssl/t1_lib.c:2153:5: 
2151.   DH *ssl_get_auto_dh(SSL *s)
2152.   {
2153. >     int dh_secbits = 80;
2154.       if (s->cert->dh_tmp_auto == 2)
2155.           return DH_get_1024_160();

ssl/t1_lib.c:2154:9: Taking false branch
2152.   {
2153.       int dh_secbits = 80;
2154.       if (s->cert->dh_tmp_auto == 2)
                ^
2155.           return DH_get_1024_160();
2156.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {

ssl/t1_lib.c:2156:9: Taking false branch
2154.       if (s->cert->dh_tmp_auto == 2)
2155.           return DH_get_1024_160();
2156.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
                ^
2157.           if (s->s3->tmp.new_cipher->strength_bits == 256)
2158.               dh_secbits = 128;

ssl/t1_lib.c:2162:9: 
2160.               dh_secbits = 80;
2161.       } else {
2162. >         CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
2163.           dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
2164.       }

ssl/ssl_lib.c:2867:1: start of procedure ssl_get_server_send_pkey()
  2865.   }
  2866.   
  2867. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
  2868.   {
  2869.       CERT *c;

ssl/ssl_lib.c:2872:5: 
  2870.       int i;
  2871.   
  2872. >     c = s->cert;
  2873.       if (!s->s3 || !s->s3->tmp.new_cipher)
  2874.           return NULL;

ssl/ssl_lib.c:2873:10: Taking false branch
  2871.   
  2872.       c = s->cert;
  2873.       if (!s->s3 || !s->s3->tmp.new_cipher)
                   ^
  2874.           return NULL;
  2875.       ssl_set_masks(s);

ssl/ssl_lib.c:2873:20: Taking false branch
  2871.   
  2872.       c = s->cert;
  2873.       if (!s->s3 || !s->s3->tmp.new_cipher)
                             ^
  2874.           return NULL;
  2875.       ssl_set_masks(s);

ssl/ssl_lib.c:2875:5: Skipping ssl_set_masks(): empty list of specs
  2873.       if (!s->s3 || !s->s3->tmp.new_cipher)
  2874.           return NULL;
  2875.       ssl_set_masks(s);
              ^
  2876.   
  2877.       i = ssl_get_server_cert_index(s);

ssl/ssl_lib.c:2877:5: Skipping ssl_get_server_cert_index(): empty list of specs
  2875.       ssl_set_masks(s);
  2876.   
  2877.       i = ssl_get_server_cert_index(s);
              ^
  2878.   
  2879.       /* This may or may not be an error. */

ssl/ssl_lib.c:2880:9: Taking true branch
  2878.   
  2879.       /* This may or may not be an error. */
  2880.       if (i < 0)
                  ^
  2881.           return NULL;
  2882.   

ssl/ssl_lib.c:2881:9: 
  2879.       /* This may or may not be an error. */
  2880.       if (i < 0)
  2881. >         return NULL;
  2882.   
  2883.       /* May be NULL. */

ssl/ssl_lib.c:2885:1: return from a call to ssl_get_server_send_pkey
  2883.       /* May be NULL. */
  2884.       return &c->pkeys[i];
  2885. > }
  2886.   
  2887.   EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,

ssl/t1_lib.c:2163:9: 
2161.       } else {
2162.           CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
2163. >         dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
2164.       }
2165.   
