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


ssl/t1_lib.c:4192:1: start of procedure ssl_get_auto_dh()
4190.   
4191.   #ifndef OPENSSL_NO_DH
4192. > DH *ssl_get_auto_dh(SSL *s)
4193.   {
4194.       int dh_secbits = 80;

ssl/t1_lib.c:4194:5: 
4192.   DH *ssl_get_auto_dh(SSL *s)
4193.   {
4194. >     int dh_secbits = 80;
4195.       if (s->cert->dh_tmp_auto == 2)
4196.           return DH_get_1024_160();

ssl/t1_lib.c:4195:9: Taking false branch
4193.   {
4194.       int dh_secbits = 80;
4195.       if (s->cert->dh_tmp_auto == 2)
                ^
4196.           return DH_get_1024_160();
4197.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {

ssl/t1_lib.c:4197:9: Taking false branch
4195.       if (s->cert->dh_tmp_auto == 2)
4196.           return DH_get_1024_160();
4197.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
                ^
4198.           if (s->s3->tmp.new_cipher->strength_bits == 256)
4199.               dh_secbits = 128;

ssl/t1_lib.c:4203:9: 
4201.               dh_secbits = 80;
4202.       } else {
4203. >         CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4204.           dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4205.       }

ssl/ssl_lib.c:2149:1: start of procedure ssl_get_server_send_pkey()
  2147.   }
  2148.   
  2149. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
  2150.   {
  2151.       CERT *c;

ssl/ssl_lib.c:2154:5: 
  2152.       int i;
  2153.   
  2154. >     c = s->cert;
  2155.       if (!s->s3 || !s->s3->tmp.new_cipher)
  2156.           return NULL;

ssl/ssl_lib.c:2155:10: Taking false branch
  2153.   
  2154.       c = s->cert;
  2155.       if (!s->s3 || !s->s3->tmp.new_cipher)
                   ^
  2156.           return NULL;
  2157.       ssl_set_masks(s, s->s3->tmp.new_cipher);

ssl/ssl_lib.c:2155:20: Taking false branch
  2153.   
  2154.       c = s->cert;
  2155.       if (!s->s3 || !s->s3->tmp.new_cipher)
                             ^
  2156.           return NULL;
  2157.       ssl_set_masks(s, s->s3->tmp.new_cipher);

ssl/ssl_lib.c:2157:5: Skipping ssl_set_masks(): empty list of specs
  2155.       if (!s->s3 || !s->s3->tmp.new_cipher)
  2156.           return NULL;
  2157.       ssl_set_masks(s, s->s3->tmp.new_cipher);
              ^
  2158.   
  2159.   #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL

ssl/ssl_lib.c:2168:5: Skipping ssl_get_server_cert_index(): empty list of specs
  2166.   #endif
  2167.   
  2168.       i = ssl_get_server_cert_index(s);
              ^
  2169.   
  2170.       /* This may or may not be an error. */

ssl/ssl_lib.c:2171:9: Taking true branch
  2169.   
  2170.       /* This may or may not be an error. */
  2171.       if (i < 0)
                  ^
  2172.           return NULL;
  2173.   

ssl/ssl_lib.c:2172:9: 
  2170.       /* This may or may not be an error. */
  2171.       if (i < 0)
  2172. >         return NULL;
  2173.   
  2174.       /* May be NULL. */

ssl/ssl_lib.c:2176:1: return from a call to ssl_get_server_send_pkey
  2174.       /* May be NULL. */
  2175.       return &c->pkeys[i];
  2176. > }
  2177.   
  2178.   EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,

ssl/t1_lib.c:4204:9: 
4202.       } else {
4203.           CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4204. >         dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4205.       }
4206.   
