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


ssl/s3_srvr.c:2899:1: start of procedure ssl3_get_cert_verify()
2897.   }
2898.   
2899. > int ssl3_get_cert_verify(SSL *s)
2900.   {
2901.       EVP_PKEY *pkey = NULL;

ssl/s3_srvr.c:2901:5: 
2899.   int ssl3_get_cert_verify(SSL *s)
2900.   {
2901. >     EVP_PKEY *pkey = NULL;
2902.       unsigned char *p;
2903.       int al, ok, ret = 0;

ssl/s3_srvr.c:2903:5: 
2901.       EVP_PKEY *pkey = NULL;
2902.       unsigned char *p;
2903. >     int al, ok, ret = 0;
2904.       long n;
2905.       int type = 0, i, j;

ssl/s3_srvr.c:2905:5: 
2903.       int al, ok, ret = 0;
2904.       long n;
2905. >     int type = 0, i, j;
2906.       X509 *peer;
2907.       const EVP_MD *md = NULL;

ssl/s3_srvr.c:2907:5: 
2905.       int type = 0, i, j;
2906.       X509 *peer;
2907. >     const EVP_MD *md = NULL;
2908.       EVP_MD_CTX mctx;
2909.       EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:2909:5: 
2907.       const EVP_MD *md = NULL;
2908.       EVP_MD_CTX mctx;
2909. >     EVP_MD_CTX_init(&mctx);
2910.   
2911.       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:2911:5: Skipping __function_pointer__(): unresolved function pointer
2909.       EVP_MD_CTX_init(&mctx);
2910.   
2911.       n = s->method->ssl_get_message(s,
            ^
2912.                                      SSL3_ST_SR_CERT_VRFY_A,
2913.                                      SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:2916:10: Taking false branch
2914.                                      -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
2915.   
2916.       if (!ok)
                 ^
2917.           return ((int)n);
2918.   

ssl/s3_srvr.c:2919:9: Taking true branch
2917.           return ((int)n);
2918.   
2919.       if (s->session->peer != NULL) {
                ^
2920.           peer = s->session->peer;
2921.           pkey = X509_get_pubkey(peer);

ssl/s3_srvr.c:2920:9: 
2918.   
2919.       if (s->session->peer != NULL) {
2920. >         peer = s->session->peer;
2921.           pkey = X509_get_pubkey(peer);
2922.           type = X509_certificate_type(peer, pkey);

ssl/s3_srvr.c:2921:9: 
2919.       if (s->session->peer != NULL) {
2920.           peer = s->session->peer;
2921. >         pkey = X509_get_pubkey(peer);
2922.           type = X509_certificate_type(peer, pkey);
2923.       } else {

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

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

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

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

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

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

ssl/s3_srvr.c:2928:9: Taking false branch
2926.       }
2927.   
2928.       if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
                ^
2929.           s->s3->tmp.reuse_message = 1;
2930.           if (peer != NULL) {

ssl/s3_srvr.c:2939:9: Taking false branch
2937.       }
2938.   
2939.       if (peer == NULL) {
                ^
2940.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_NO_CLIENT_CERT_RECEIVED);
2941.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2945:11: Taking false branch
2943.       }
2944.   
2945.       if (!(type & EVP_PKT_SIGN)) {
                  ^
2946.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,
2947.                  SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:2952:9: Taking false branch
2950.       }
2951.   
2952.       if (s->s3->change_cipher_spec) {
                ^
2953.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_CCS_RECEIVED_EARLY);
2954.           al = SSL_AD_UNEXPECTED_MESSAGE;

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

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

ssl/s3_srvr.c:2965:21: 
2963.        * length field
2964.        */
2965. >     if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
2966.                       pkey->type == NID_id_GostR3410_2001)) {
2967.           i = 64;
