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


ssl/t1_lib.c:4187:1: start of procedure ssl_get_auto_dh()
4185.   
4186.   #ifndef OPENSSL_NO_DH
4187. > DH *ssl_get_auto_dh(SSL *s)
4188.   {
4189.       int dh_secbits = 80;

ssl/t1_lib.c:4189:5: 
4187.   DH *ssl_get_auto_dh(SSL *s)
4188.   {
4189. >     int dh_secbits = 80;
4190.       if (s->cert->dh_tmp_auto == 2)
4191.           return DH_get_1024_160();

ssl/t1_lib.c:4190:9: Taking false branch
4188.   {
4189.       int dh_secbits = 80;
4190.       if (s->cert->dh_tmp_auto == 2)
                ^
4191.           return DH_get_1024_160();
4192.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {

ssl/t1_lib.c:4192:9: Taking false branch
4190.       if (s->cert->dh_tmp_auto == 2)
4191.           return DH_get_1024_160();
4192.       if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
                ^
4193.           if (s->s3->tmp.new_cipher->strength_bits == 256)
4194.               dh_secbits = 128;

ssl/t1_lib.c:4198:9: 
4196.               dh_secbits = 80;
4197.       } else {
4198. >         CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4199.           dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4200.       }

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

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

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

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

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

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

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

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

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

ssl/t1_lib.c:4199:9: 
4197.       } else {
4198.           CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4199. >         dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4200.       }
4201.   
