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


ssl/t1_lib.c:4171:1: start of procedure ssl_get_auto_dh()
4169.   
4170.   #ifndef OPENSSL_NO_DH
4171. > DH *ssl_get_auto_dh(SSL *s)
4172.   {
4173.       int dh_secbits = 80;

ssl/t1_lib.c:4173:5: 
4171.   DH *ssl_get_auto_dh(SSL *s)
4172.   {
4173. >     int dh_secbits = 80;
4174.       if (s->cert->dh_tmp_auto == 2)
4175.           return DH_get_1024_160();

ssl/t1_lib.c:4174:9: Taking false branch
4172.   {
4173.       int dh_secbits = 80;
4174.       if (s->cert->dh_tmp_auto == 2)
                ^
4175.           return DH_get_1024_160();
4176.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {

ssl/t1_lib.c:4176:9: Taking false branch
4174.       if (s->cert->dh_tmp_auto == 2)
4175.           return DH_get_1024_160();
4176.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
                ^
4177.           if (s->s3->tmp.new_cipher->strength_bits == 256)
4178.               dh_secbits = 128;

ssl/t1_lib.c:4182:9: 
4180.               dh_secbits = 80;
4181.       } else {
4182. >         CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4183.           dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4184.       }

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

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

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

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

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

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

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

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

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

ssl/t1_lib.c:4183:9: 
4181.       } else {
4182.           CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4183. >         dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4184.       }
4185.   
