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


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

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

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

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

crypto/x509/x509_vfy.c:868:2: 
866.   	unsigned int last_reasons;
867.   	cnum = ctx->error_depth;
868. > 	x = sk_X509_value(ctx->chain, cnum);
869.   	ctx->current_cert = x;
870.   	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:869:2: 
867.   	cnum = ctx->error_depth;
868.   	x = sk_X509_value(ctx->chain, cnum);
869. > 	ctx->current_cert = x;
870.   	ctx->current_issuer = NULL;
871.   	ctx->current_crl_score = 0;

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

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

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

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

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

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

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

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

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

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

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

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