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


ssl/s3_srvr.c:2855:1: start of procedure ssl3_get_cert_verify()
2853.   }
2854.   
2855. > int ssl3_get_cert_verify(SSL *s)
2856.   {
2857.       EVP_PKEY *pkey = NULL;

ssl/s3_srvr.c:2857:5: 
2855.   int ssl3_get_cert_verify(SSL *s)
2856.   {
2857. >     EVP_PKEY *pkey = NULL;
2858.       unsigned char *p;
2859.       int al, ok, ret = 0;

ssl/s3_srvr.c:2859:5: 
2857.       EVP_PKEY *pkey = NULL;
2858.       unsigned char *p;
2859. >     int al, ok, ret = 0;
2860.       long n;
2861.       int type = 0, i, j;

ssl/s3_srvr.c:2861:5: 
2859.       int al, ok, ret = 0;
2860.       long n;
2861. >     int type = 0, i, j;
2862.       X509 *peer;
2863.       const EVP_MD *md = NULL;

ssl/s3_srvr.c:2863:5: 
2861.       int type = 0, i, j;
2862.       X509 *peer;
2863. >     const EVP_MD *md = NULL;
2864.       EVP_MD_CTX mctx;
2865.       EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:2865:5: 
2863.       const EVP_MD *md = NULL;
2864.       EVP_MD_CTX mctx;
2865. >     EVP_MD_CTX_init(&mctx);
2866.   
2867.       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:2867:5: Skipping __function_pointer__(): unresolved function pointer
2865.       EVP_MD_CTX_init(&mctx);
2866.   
2867.       n = s->method->ssl_get_message(s,
            ^
2868.                                      SSL3_ST_SR_CERT_VRFY_A,
2869.                                      SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:2872:10: Taking false branch
2870.                                      -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
2871.   
2872.       if (!ok)
                 ^
2873.           return ((int)n);
2874.   

ssl/s3_srvr.c:2875:9: Taking true branch
2873.           return ((int)n);
2874.   
2875.       if (s->session->peer != NULL) {
                ^
2876.           peer = s->session->peer;
2877.           pkey = X509_get_pubkey(peer);

ssl/s3_srvr.c:2876:9: 
2874.   
2875.       if (s->session->peer != NULL) {
2876. >         peer = s->session->peer;
2877.           pkey = X509_get_pubkey(peer);
2878.           type = X509_certificate_type(peer, pkey);

ssl/s3_srvr.c:2877:9: 
2875.       if (s->session->peer != NULL) {
2876.           peer = s->session->peer;
2877. >         pkey = X509_get_pubkey(peer);
2878.           type = X509_certificate_type(peer, pkey);
2879.       } 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:2878:9: Skipping X509_certificate_type(): empty list of specs
2876.           peer = s->session->peer;
2877.           pkey = X509_get_pubkey(peer);
2878.           type = X509_certificate_type(peer, pkey);
                ^
2879.       } else {
2880.           peer = NULL;

ssl/s3_srvr.c:2884:9: Taking false branch
2882.       }
2883.   
2884.       if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
                ^
2885.           s->s3->tmp.reuse_message = 1;
2886.           if (peer != NULL) {

ssl/s3_srvr.c:2895:9: Taking false branch
2893.       }
2894.   
2895.       if (peer == NULL) {
                ^
2896.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_NO_CLIENT_CERT_RECEIVED);
2897.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2901:11: Taking false branch
2899.       }
2900.   
2901.       if (!(type & EVP_PKT_SIGN)) {
                  ^
2902.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,
2903.                  SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:2908:9: Taking false branch
2906.       }
2907.   
2908.       if (s->s3->change_cipher_spec) {
                ^
2909.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_CCS_RECEIVED_EARLY);
2910.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2915:5: 
2913.   
2914.       /* we now have a signature that we need to verify */
2915. >     p = (unsigned char *)s->init_msg;
2916.       /* Check for broken implementations of GOST ciphersuites */
2917.       /*

ssl/s3_srvr.c:2921:9: Taking true branch
2919.        * length field
2920.        */
2921.       if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
                ^
2922.                       pkey->type == NID_id_GostR3410_2001)) {
2923.           i = 64;

ssl/s3_srvr.c:2921:21: 
2919.        * length field
2920.        */
2921. >     if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
2922.                       pkey->type == NID_id_GostR3410_2001)) {
2923.           i = 64;
