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


ssl/s3_srvr.c:3070:1: start of procedure ssl3_get_cert_verify()
3068.   	}
3069.   
3070. > int ssl3_get_cert_verify(SSL *s)
3071.   	{
3072.   	EVP_PKEY *pkey=NULL;

ssl/s3_srvr.c:3072:2: 
3070.   int ssl3_get_cert_verify(SSL *s)
3071.   	{
3072. > 	EVP_PKEY *pkey=NULL;
3073.   	unsigned char *p;
3074.   	int al,ok,ret=0;

ssl/s3_srvr.c:3074:2: 
3072.   	EVP_PKEY *pkey=NULL;
3073.   	unsigned char *p;
3074. > 	int al,ok,ret=0;
3075.   	long n;
3076.   	int type=0,i,j;

ssl/s3_srvr.c:3076:2: 
3074.   	int al,ok,ret=0;
3075.   	long n;
3076. > 	int type=0,i,j;
3077.   	X509 *peer;
3078.   	const EVP_MD *md = NULL;

ssl/s3_srvr.c:3078:2: 
3076.   	int type=0,i,j;
3077.   	X509 *peer;
3078. > 	const EVP_MD *md = NULL;
3079.   	EVP_MD_CTX mctx;
3080.   	EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:3080:2: 
3078.   	const EVP_MD *md = NULL;
3079.   	EVP_MD_CTX mctx;
3080. > 	EVP_MD_CTX_init(&mctx);
3081.   
3082.   	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:3082:2: Skipping __function_pointer__(): unresolved function pointer
3080.   	EVP_MD_CTX_init(&mctx);
3081.   
3082.   	n=s->method->ssl_get_message(s,
         ^
3083.   		SSL3_ST_SR_CERT_VRFY_A,
3084.   		SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:3089:7: Taking false branch
3087.   		&ok);
3088.   
3089.   	if (!ok) return((int)n);
              ^
3090.   
3091.   	if (s->session->peer != NULL)

ssl/s3_srvr.c:3091:6: Taking true branch
3089.   	if (!ok) return((int)n);
3090.   
3091.   	if (s->session->peer != NULL)
             ^
3092.   		{
3093.   		peer=s->session->peer;

ssl/s3_srvr.c:3093:3: 
3091.   	if (s->session->peer != NULL)
3092.   		{
3093. > 		peer=s->session->peer;
3094.   		pkey=X509_get_pubkey(peer);
3095.   		type=X509_certificate_type(peer,pkey);

ssl/s3_srvr.c:3094:3: 
3092.   		{
3093.   		peer=s->session->peer;
3094. > 		pkey=X509_get_pubkey(peer);
3095.   		type=X509_certificate_type(peer,pkey);
3096.   		}

crypto/x509/x509_cmp.c:313:1: start of procedure X509_get_pubkey()
  311.   	}
  312.   
  313. > EVP_PKEY *X509_get_pubkey(X509 *x)
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:315:7: Taking false branch
  313.   EVP_PKEY *X509_get_pubkey(X509 *x)
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  316.   		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:315:22: Taking true branch
  313.   EVP_PKEY *X509_get_pubkey(X509 *x)
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  316.   		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:316:3: 
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))
  316. > 		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));
  318.   	}

crypto/x509/x509_cmp.c:318:2: return from a call to X509_get_pubkey
  316.   		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));
  318.   	}
          ^
  319.   
  320.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

ssl/s3_srvr.c:3095:3: Skipping X509_certificate_type(): empty list of specs
3093.   		peer=s->session->peer;
3094.   		pkey=X509_get_pubkey(peer);
3095.   		type=X509_certificate_type(peer,pkey);
          ^
3096.   		}
3097.   	else

ssl/s3_srvr.c:3103:6: Taking false branch
3101.   		}
3102.   
3103.   	if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY)
             ^
3104.   		{
3105.   		s->s3->tmp.reuse_message=1;

ssl/s3_srvr.c:3116:6: Taking false branch
3114.   		}
3115.   
3116.   	if (peer == NULL)
             ^
3117.   		{
3118.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED);

ssl/s3_srvr.c:3123:8: Taking false branch
3121.   		}
3122.   
3123.   	if (!(type & EVP_PKT_SIGN))
               ^
3124.   		{
3125.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:3130:6: Taking false branch
3128.   		}
3129.   
3130.   	if (s->s3->change_cipher_spec)
             ^
3131.   		{
3132.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY);

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

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

ssl/s3_srvr.c:3142:16: 
3140.   	/* If key is GOST and n is exactly 64, it is bare
3141.   	 * signature without length field */
3142. > 	if (n==64 && (pkey->type==NID_id_GostR3410_94 ||
3143.   		pkey->type == NID_id_GostR3410_2001) )
3144.   		{
