crypto/x509/x509_vfy.c:805: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 794 could be null and is dereferenced by call to `get_crl_delta()` at line 805, column 9.
Showing all 25 steps of the trace


crypto/x509/x509_vfy.c:788:1: start of procedure check_cert()
786.   	}
787.   
788. > static int check_cert(X509_STORE_CTX *ctx)
789.   	{
790.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:790:2: 
788.   static int check_cert(X509_STORE_CTX *ctx)
789.   	{
790. > 	X509_CRL *crl = NULL, *dcrl = NULL;
791.   	X509 *x;
792.   	int ok, cnum;

crypto/x509/x509_vfy.c:793:2: 
791.   	X509 *x;
792.   	int ok, cnum;
793. > 	cnum = ctx->error_depth;
794.   	x = sk_X509_value(ctx->chain, cnum);
795.   	ctx->current_cert = x;

crypto/x509/x509_vfy.c:794:6: Condition is true
792.   	int ok, cnum;
793.   	cnum = ctx->error_depth;
794.   	x = sk_X509_value(ctx->chain, cnum);
            ^
795.   	ctx->current_cert = x;
796.   	ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:794:2: 
792.   	int ok, cnum;
793.   	cnum = ctx->error_depth;
794. > 	x = sk_X509_value(ctx->chain, cnum);
795.   	ctx->current_cert = x;
796.   	ctx->current_issuer = NULL;

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking true branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:39: 
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:795:2: 
793.   	cnum = ctx->error_depth;
794.   	x = sk_X509_value(ctx->chain, cnum);
795. > 	ctx->current_cert = x;
796.   	ctx->current_issuer = NULL;
797.   	ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:796:2: 
794.   	x = sk_X509_value(ctx->chain, cnum);
795.   	ctx->current_cert = x;
796. > 	ctx->current_issuer = NULL;
797.   	ctx->current_crl_score = 0;
798.   	ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:797:2: 
795.   	ctx->current_cert = x;
796.   	ctx->current_issuer = NULL;
797. > 	ctx->current_crl_score = 0;
798.   	ctx->current_reasons = 0;
799.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)

crypto/x509/x509_vfy.c:798:2: 
796.   	ctx->current_issuer = NULL;
797.   	ctx->current_crl_score = 0;
798. > 	ctx->current_reasons = 0;
799.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
800.   		{

crypto/x509/x509_vfy.c:799:9: Loop condition is true. Entering loop body
797.   	ctx->current_crl_score = 0;
798.   	ctx->current_reasons = 0;
799.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
               ^
800.   		{
801.   		/* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:802:7: Taking false branch
800.   		{
801.   		/* Try to retrieve relevant CRL */
802.   		if (ctx->get_crl)
             ^
803.   			ok = ctx->get_crl(ctx, &crl, x);
804.   		else

crypto/x509/x509_vfy.c:805:4: 
803.   			ok = ctx->get_crl(ctx, &crl, x);
804.   		else
805. > 			ok = get_crl_delta(ctx, &crl, &dcrl, x);
806.   		/* If error looking up CRL, nothing we can do except
807.   		 * notify callback

crypto/x509/x509_vfy.c:1388:1: start of procedure get_crl_delta()
  1386.    */
  1387.   	
  1388. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1389.   				X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1390.   	{

crypto/x509/x509_vfy.c:1392:2: 
  1390.   	{
  1391.   	int ok;
  1392. > 	X509 *issuer = NULL;
  1393.   	int crl_score = 0;
  1394.   	unsigned int reasons;

crypto/x509/x509_vfy.c:1393:2: 
  1391.   	int ok;
  1392.   	X509 *issuer = NULL;
  1393. > 	int crl_score = 0;
  1394.   	unsigned int reasons;
  1395.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1395:2: 
  1393.   	int crl_score = 0;
  1394.   	unsigned int reasons;
  1395. > 	X509_CRL *crl = NULL, *dcrl = NULL;
  1396.   	STACK_OF(X509_CRL) *skcrl;
  1397.   	X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1397:2: 
  1395.   	X509_CRL *crl = NULL, *dcrl = NULL;
  1396.   	STACK_OF(X509_CRL) *skcrl;
  1397. > 	X509_NAME *nm = X509_get_issuer_name(x);
  1398.   	reasons = ctx->current_reasons;
  1399.   	ok = get_crl_sk(ctx, &crl, &dcrl, 

crypto/x509/x509_cmp.c:130:1: start of procedure X509_get_issuer_name()
    128.   #endif
    129.   
    130. > X509_NAME *X509_get_issuer_name(X509 *a)
    131.   	{
    132.   	return(a->cert_info->issuer);

crypto/x509/x509_cmp.c:132:2: 
    130.   X509_NAME *X509_get_issuer_name(X509 *a)
    131.   	{
    132. > 	return(a->cert_info->issuer);
    133.   	}
    134.   
