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


ssl/s3_srvr.c:3025:1: start of procedure ssl3_get_cert_verify()
3023.   	}
3024.   
3025. > int ssl3_get_cert_verify(SSL *s)
3026.   	{
3027.   	EVP_PKEY *pkey=NULL;

ssl/s3_srvr.c:3027:2: 
3025.   int ssl3_get_cert_verify(SSL *s)
3026.   	{
3027. > 	EVP_PKEY *pkey=NULL;
3028.   	unsigned char *p;
3029.   	int al,ok,ret=0;

ssl/s3_srvr.c:3029:2: 
3027.   	EVP_PKEY *pkey=NULL;
3028.   	unsigned char *p;
3029. > 	int al,ok,ret=0;
3030.   	long n;
3031.   	int type=0,i,j;

ssl/s3_srvr.c:3031:2: 
3029.   	int al,ok,ret=0;
3030.   	long n;
3031. > 	int type=0,i,j;
3032.   	X509 *peer;
3033.   	const EVP_MD *md = NULL;

ssl/s3_srvr.c:3033:2: 
3031.   	int type=0,i,j;
3032.   	X509 *peer;
3033. > 	const EVP_MD *md = NULL;
3034.   	EVP_MD_CTX mctx;
3035.   	EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:3035:2: 
3033.   	const EVP_MD *md = NULL;
3034.   	EVP_MD_CTX mctx;
3035. > 	EVP_MD_CTX_init(&mctx);
3036.   
3037.   	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:2: 
  120.   void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
  121.   	{
  122. > 	memset(ctx,'\0',sizeof *ctx);
  123.   	}
  124.   

crypto/evp/digest.c:123:2: 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:3037:2: Skipping __function_pointer__(): unresolved function pointer
3035.   	EVP_MD_CTX_init(&mctx);
3036.   
3037.   	n=s->method->ssl_get_message(s,
         ^
3038.   		SSL3_ST_SR_CERT_VRFY_A,
3039.   		SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:3044:7: Taking false branch
3042.   		&ok);
3043.   
3044.   	if (!ok) return((int)n);
              ^
3045.   
3046.   	if (s->session->peer != NULL)

ssl/s3_srvr.c:3046:6: Taking true branch
3044.   	if (!ok) return((int)n);
3045.   
3046.   	if (s->session->peer != NULL)
             ^
3047.   		{
3048.   		peer=s->session->peer;

ssl/s3_srvr.c:3048:3: 
3046.   	if (s->session->peer != NULL)
3047.   		{
3048. > 		peer=s->session->peer;
3049.   		pkey=X509_get_pubkey(peer);
3050.   		type=X509_certificate_type(peer,pkey);

ssl/s3_srvr.c:3049:3: 
3047.   		{
3048.   		peer=s->session->peer;
3049. > 		pkey=X509_get_pubkey(peer);
3050.   		type=X509_certificate_type(peer,pkey);
3051.   		}

crypto/x509/x509_cmp.c:300:1: start of procedure X509_get_pubkey()
  298.   	}
  299.   
  300. > EVP_PKEY *X509_get_pubkey(X509 *x)
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:302:7: Taking false branch
  300.   EVP_PKEY *X509_get_pubkey(X509 *x)
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  303.   		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:302:22: Taking true branch
  300.   EVP_PKEY *X509_get_pubkey(X509 *x)
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  303.   		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:303:3: 
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))
  303. > 		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));
  305.   	}

crypto/x509/x509_cmp.c:305:2: return from a call to X509_get_pubkey
  303.   		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));
  305.   	}
          ^
  306.   
  307.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

ssl/s3_srvr.c:3050:3: Skipping X509_certificate_type(): empty list of specs
3048.   		peer=s->session->peer;
3049.   		pkey=X509_get_pubkey(peer);
3050.   		type=X509_certificate_type(peer,pkey);
          ^
3051.   		}
3052.   	else

ssl/s3_srvr.c:3058:6: Taking false branch
3056.   		}
3057.   
3058.   	if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY)
             ^
3059.   		{
3060.   		s->s3->tmp.reuse_message=1;

ssl/s3_srvr.c:3071:6: Taking false branch
3069.   		}
3070.   
3071.   	if (peer == NULL)
             ^
3072.   		{
3073.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED);

ssl/s3_srvr.c:3078:8: Taking false branch
3076.   		}
3077.   
3078.   	if (!(type & EVP_PKT_SIGN))
               ^
3079.   		{
3080.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:3085:6: Taking false branch
3083.   		}
3084.   
3085.   	if (s->s3->change_cipher_spec)
             ^
3086.   		{
3087.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY);

ssl/s3_srvr.c:3093:2: 
3091.   
3092.   	/* we now have a signature that we need to verify */
3093. > 	p=(unsigned char *)s->init_msg;
3094.   	/* Check for broken implementations of GOST ciphersuites */
3095.   	/* If key is GOST and n is exactly 64, it is bare

ssl/s3_srvr.c:3097:6: Taking true branch
3095.   	/* If key is GOST and n is exactly 64, it is bare
3096.   	 * signature without length field */
3097.   	if (n==64 && (pkey->type==NID_id_GostR3410_94 ||
             ^
3098.   		pkey->type == NID_id_GostR3410_2001) )
3099.   		{

ssl/s3_srvr.c:3097:16: 
3095.   	/* If key is GOST and n is exactly 64, it is bare
3096.   	 * signature without length field */
3097. > 	if (n==64 && (pkey->type==NID_id_GostR3410_94 ||
3098.   		pkey->type == NID_id_GostR3410_2001) )
3099.   		{
