ssl/s3_srvr.c:2961: error: NULL_DEREFERENCE
  pointer `pkey` last assigned on line 2917 could be null and is dereferenced at line 2961, column 21.
Showing all 27 steps of the trace


ssl/s3_srvr.c:2895:1: start of procedure ssl3_get_cert_verify()
2893.   }
2894.   
2895. > int ssl3_get_cert_verify(SSL *s)
2896.   {
2897.       EVP_PKEY *pkey = NULL;

ssl/s3_srvr.c:2897:5: 
2895.   int ssl3_get_cert_verify(SSL *s)
2896.   {
2897. >     EVP_PKEY *pkey = NULL;
2898.       unsigned char *p;
2899.       int al, ok, ret = 0;

ssl/s3_srvr.c:2899:5: 
2897.       EVP_PKEY *pkey = NULL;
2898.       unsigned char *p;
2899. >     int al, ok, ret = 0;
2900.       long n;
2901.       int type = 0, i, j;

ssl/s3_srvr.c:2901:5: 
2899.       int al, ok, ret = 0;
2900.       long n;
2901. >     int type = 0, i, j;
2902.       X509 *peer;
2903.       const EVP_MD *md = NULL;

ssl/s3_srvr.c:2903:5: 
2901.       int type = 0, i, j;
2902.       X509 *peer;
2903. >     const EVP_MD *md = NULL;
2904.       EVP_MD_CTX mctx;
2905.       EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:2905:5: 
2903.       const EVP_MD *md = NULL;
2904.       EVP_MD_CTX mctx;
2905. >     EVP_MD_CTX_init(&mctx);
2906.   
2907.       n = s->method->ssl_get_message(s,

crypto/evp/digest.c:120:1: start of procedure EVP_MD_CTX_init()
  118.   #endif
  119.   
  120. > void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
  121.   {
  122.       memset(ctx, '\0', sizeof *ctx);

crypto/evp/digest.c:122:5: 
  120.   void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
  121.   {
  122. >     memset(ctx, '\0', sizeof *ctx);
  123.   }
  124.   

crypto/evp/digest.c:123:1: return from a call to EVP_MD_CTX_init
  121.   {
  122.       memset(ctx, '\0', sizeof *ctx);
  123. > }
  124.   
  125.   EVP_MD_CTX *EVP_MD_CTX_create(void)

ssl/s3_srvr.c:2907:5: Skipping __function_pointer__(): unresolved function pointer
2905.       EVP_MD_CTX_init(&mctx);
2906.   
2907.       n = s->method->ssl_get_message(s,
            ^
2908.                                      SSL3_ST_SR_CERT_VRFY_A,
2909.                                      SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:2912:10: Taking false branch
2910.                                      -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
2911.   
2912.       if (!ok)
                 ^
2913.           return ((int)n);
2914.   

ssl/s3_srvr.c:2915:9: Taking true branch
2913.           return ((int)n);
2914.   
2915.       if (s->session->peer != NULL) {
                ^
2916.           peer = s->session->peer;
2917.           pkey = X509_get_pubkey(peer);

ssl/s3_srvr.c:2916:9: 
2914.   
2915.       if (s->session->peer != NULL) {
2916. >         peer = s->session->peer;
2917.           pkey = X509_get_pubkey(peer);
2918.           type = X509_certificate_type(peer, pkey);

ssl/s3_srvr.c:2917:9: 
2915.       if (s->session->peer != NULL) {
2916.           peer = s->session->peer;
2917. >         pkey = X509_get_pubkey(peer);
2918.           type = X509_certificate_type(peer, pkey);
2919.       } else {

crypto/x509/x509_cmp.c:307:1: start of procedure X509_get_pubkey()
  305.   }
  306.   
  307. > EVP_PKEY *X509_get_pubkey(X509 *x)
  308.   {
  309.       if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:309:10: Taking false branch
  307.   EVP_PKEY *X509_get_pubkey(X509 *x)
  308.   {
  309.       if ((x == NULL) || (x->cert_info == NULL))
                  ^
  310.           return (NULL);
  311.       return (X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:309:25: Taking true branch
  307.   EVP_PKEY *X509_get_pubkey(X509 *x)
  308.   {
  309.       if ((x == NULL) || (x->cert_info == NULL))
                                 ^
  310.           return (NULL);
  311.       return (X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:310:9: 
  308.   {
  309.       if ((x == NULL) || (x->cert_info == NULL))
  310. >         return (NULL);
  311.       return (X509_PUBKEY_get(x->cert_info->key));
  312.   }

crypto/x509/x509_cmp.c:312:1: return from a call to X509_get_pubkey
  310.           return (NULL);
  311.       return (X509_PUBKEY_get(x->cert_info->key));
  312. > }
  313.   
  314.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

ssl/s3_srvr.c:2918:9: Skipping X509_certificate_type(): empty list of specs
2916.           peer = s->session->peer;
2917.           pkey = X509_get_pubkey(peer);
2918.           type = X509_certificate_type(peer, pkey);
                ^
2919.       } else {
2920.           peer = NULL;

ssl/s3_srvr.c:2924:9: Taking false branch
2922.       }
2923.   
2924.       if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
                ^
2925.           s->s3->tmp.reuse_message = 1;
2926.           if (peer != NULL) {

ssl/s3_srvr.c:2935:9: Taking false branch
2933.       }
2934.   
2935.       if (peer == NULL) {
                ^
2936.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_NO_CLIENT_CERT_RECEIVED);
2937.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2941:11: Taking false branch
2939.       }
2940.   
2941.       if (!(type & EVP_PKT_SIGN)) {
                  ^
2942.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,
2943.                  SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:2948:9: Taking false branch
2946.       }
2947.   
2948.       if (s->s3->change_cipher_spec) {
                ^
2949.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_CCS_RECEIVED_EARLY);
2950.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2955:5: 
2953.   
2954.       /* we now have a signature that we need to verify */
2955. >     p = (unsigned char *)s->init_msg;
2956.       /* Check for broken implementations of GOST ciphersuites */
2957.       /*

ssl/s3_srvr.c:2961:9: Taking true branch
2959.        * length field
2960.        */
2961.       if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
                ^
2962.                       pkey->type == NID_id_GostR3410_2001)) {
2963.           i = 64;

ssl/s3_srvr.c:2961:21: 
2959.        * length field
2960.        */
2961. >     if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
2962.                       pkey->type == NID_id_GostR3410_2001)) {
2963.           i = 64;
