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


crypto/x509/x509_vfy.c:859:1: start of procedure check_cert()
857.   	}
858.   
859. > static int check_cert(X509_STORE_CTX *ctx)
860.   	{
861.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:861:2: 
859.   static int check_cert(X509_STORE_CTX *ctx)
860.   	{
861. > 	X509_CRL *crl = NULL, *dcrl = NULL;
862.   	X509 *x;
863.   	int ok, cnum;

crypto/x509/x509_vfy.c:865:2: 
863.   	int ok, cnum;
864.   	unsigned int last_reasons;
865. > 	cnum = ctx->error_depth;
866.   	x = sk_X509_value(ctx->chain, cnum);
867.   	ctx->current_cert = x;

crypto/x509/x509_vfy.c:866:6: Condition is true
864.   	unsigned int last_reasons;
865.   	cnum = ctx->error_depth;
866.   	x = sk_X509_value(ctx->chain, cnum);
            ^
867.   	ctx->current_cert = x;
868.   	ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:866:2: 
864.   	unsigned int last_reasons;
865.   	cnum = ctx->error_depth;
866. > 	x = sk_X509_value(ctx->chain, cnum);
867.   	ctx->current_cert = x;
868.   	ctx->current_issuer = NULL;

crypto/stack/stack.c:337:1: start of procedure sk_value()
  335.   }
  336.   
  337. > void *sk_value(const _STACK *st, int i)
  338.   {
  339.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:339:6: Taking false branch
  337.   void *sk_value(const _STACK *st, int i)
  338.   {
  339.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  340.   	return st->data[i];
  341.   }

crypto/stack/stack.c:339:13: Taking false branch
  337.   void *sk_value(const _STACK *st, int i)
  338.   {
  339.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  340.   	return st->data[i];
  341.   }

crypto/stack/stack.c:339:24: Taking true branch
  337.   void *sk_value(const _STACK *st, int i)
  338.   {
  339.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  340.   	return st->data[i];
  341.   }

crypto/stack/stack.c:339:39: 
  337.   void *sk_value(const _STACK *st, int i)
  338.   {
  339. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  340.   	return st->data[i];
  341.   }

crypto/stack/stack.c:341:1: return from a call to sk_value
  339.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  340.   	return st->data[i];
  341. > }
  342.   
  343.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:867:2: 
865.   	cnum = ctx->error_depth;
866.   	x = sk_X509_value(ctx->chain, cnum);
867. > 	ctx->current_cert = x;
868.   	ctx->current_issuer = NULL;
869.   	ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:868:2: 
866.   	x = sk_X509_value(ctx->chain, cnum);
867.   	ctx->current_cert = x;
868. > 	ctx->current_issuer = NULL;
869.   	ctx->current_crl_score = 0;
870.   	ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:869:2: 
867.   	ctx->current_cert = x;
868.   	ctx->current_issuer = NULL;
869. > 	ctx->current_crl_score = 0;
870.   	ctx->current_reasons = 0;
871.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)

crypto/x509/x509_vfy.c:870:2: 
868.   	ctx->current_issuer = NULL;
869.   	ctx->current_crl_score = 0;
870. > 	ctx->current_reasons = 0;
871.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
872.   		{

crypto/x509/x509_vfy.c:871:9: Loop condition is true. Entering loop body
869.   	ctx->current_crl_score = 0;
870.   	ctx->current_reasons = 0;
871.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
               ^
872.   		{
873.   		last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:873:3: 
871.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
872.   		{
873. > 		last_reasons = ctx->current_reasons;
874.   		/* Try to retrieve relevant CRL */
875.   		if (ctx->get_crl)

crypto/x509/x509_vfy.c:875:7: Taking false branch
873.   		last_reasons = ctx->current_reasons;
874.   		/* Try to retrieve relevant CRL */
875.   		if (ctx->get_crl)
             ^
876.   			ok = ctx->get_crl(ctx, &crl, x);
877.   		else

crypto/x509/x509_vfy.c:878:4: 
876.   			ok = ctx->get_crl(ctx, &crl, x);
877.   		else
878. > 			ok = get_crl_delta(ctx, &crl, &dcrl, x);
879.   		/* If error looking up CRL, nothing we can do except
880.   		 * notify callback

crypto/x509/x509_vfy.c:1470:1: start of procedure get_crl_delta()
  1468.    */
  1469.   	
  1470. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1471.   				X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1472.   	{

crypto/x509/x509_vfy.c:1474:2: 
  1472.   	{
  1473.   	int ok;
  1474. > 	X509 *issuer = NULL;
  1475.   	int crl_score = 0;
  1476.   	unsigned int reasons;

crypto/x509/x509_vfy.c:1475:2: 
  1473.   	int ok;
  1474.   	X509 *issuer = NULL;
  1475. > 	int crl_score = 0;
  1476.   	unsigned int reasons;
  1477.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1477:2: 
  1475.   	int crl_score = 0;
  1476.   	unsigned int reasons;
  1477. > 	X509_CRL *crl = NULL, *dcrl = NULL;
  1478.   	STACK_OF(X509_CRL) *skcrl;
  1479.   	X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1479:2: 
  1477.   	X509_CRL *crl = NULL, *dcrl = NULL;
  1478.   	STACK_OF(X509_CRL) *skcrl;
  1479. > 	X509_NAME *nm = X509_get_issuer_name(x);
  1480.   	reasons = ctx->current_reasons;
  1481.   	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.   
