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


crypto/x509/x509_vfy.c:692:1: start of procedure check_cert()
690.   	}
691.   
692. > static int check_cert(X509_STORE_CTX *ctx)
693.   	{
694.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:694:2: 
692.   static int check_cert(X509_STORE_CTX *ctx)
693.   	{
694. > 	X509_CRL *crl = NULL, *dcrl = NULL;
695.   	X509 *x;
696.   	int ok, cnum;

crypto/x509/x509_vfy.c:697:2: 
695.   	X509 *x;
696.   	int ok, cnum;
697. > 	cnum = ctx->error_depth;
698.   	x = sk_X509_value(ctx->chain, cnum);
699.   	ctx->current_cert = x;

crypto/x509/x509_vfy.c:698:6: Condition is true
696.   	int ok, cnum;
697.   	cnum = ctx->error_depth;
698.   	x = sk_X509_value(ctx->chain, cnum);
            ^
699.   	ctx->current_cert = x;
700.   	ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:698:2: 
696.   	int ok, cnum;
697.   	cnum = ctx->error_depth;
698. > 	x = sk_X509_value(ctx->chain, cnum);
699.   	ctx->current_cert = x;
700.   	ctx->current_issuer = NULL;

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:13: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:24: Taking true branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:39: 
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:312:1: return from a call to sk_value
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312. > }
  313.   
  314.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:699:2: 
697.   	cnum = ctx->error_depth;
698.   	x = sk_X509_value(ctx->chain, cnum);
699. > 	ctx->current_cert = x;
700.   	ctx->current_issuer = NULL;
701.   	ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:700:2: 
698.   	x = sk_X509_value(ctx->chain, cnum);
699.   	ctx->current_cert = x;
700. > 	ctx->current_issuer = NULL;
701.   	ctx->current_reasons = 0;
702.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)

crypto/x509/x509_vfy.c:701:2: 
699.   	ctx->current_cert = x;
700.   	ctx->current_issuer = NULL;
701. > 	ctx->current_reasons = 0;
702.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
703.   		{

crypto/x509/x509_vfy.c:702:9: Loop condition is true. Entering loop body
700.   	ctx->current_issuer = NULL;
701.   	ctx->current_reasons = 0;
702.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
               ^
703.   		{
704.   		/* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:705:7: Taking false branch
703.   		{
704.   		/* Try to retrieve relevant CRL */
705.   		if (ctx->get_crl)
             ^
706.   			ok = ctx->get_crl(ctx, &crl, x);
707.   		else

crypto/x509/x509_vfy.c:708:4: 
706.   			ok = ctx->get_crl(ctx, &crl, x);
707.   		else
708. > 			ok = get_crl_delta(ctx, &crl, &dcrl, x);
709.   		/* If error looking up CRL, nothing we can do except
710.   		 * notify callback

crypto/x509/x509_vfy.c:1290:1: start of procedure get_crl_delta()
  1288.    */
  1289.   	
  1290. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1291.   				X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1292.   	{

crypto/x509/x509_vfy.c:1294:2: 
  1292.   	{
  1293.   	int ok;
  1294. > 	X509 *issuer = NULL;
  1295.   	int crl_score = 0;
  1296.   	unsigned int reasons;

crypto/x509/x509_vfy.c:1295:2: 
  1293.   	int ok;
  1294.   	X509 *issuer = NULL;
  1295. > 	int crl_score = 0;
  1296.   	unsigned int reasons;
  1297.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1297:2: 
  1295.   	int crl_score = 0;
  1296.   	unsigned int reasons;
  1297. > 	X509_CRL *crl = NULL, *dcrl = NULL;
  1298.   	STACK_OF(X509_CRL) *skcrl;
  1299.   	X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1299:2: 
  1297.   	X509_CRL *crl = NULL, *dcrl = NULL;
  1298.   	STACK_OF(X509_CRL) *skcrl;
  1299. > 	X509_NAME *nm = X509_get_issuer_name(x);
  1300.   	reasons = ctx->current_reasons;
  1301.   	ok = get_crl_sk(ctx, &crl, &dcrl, 

crypto/x509/x509_cmp.c:126:1: start of procedure X509_get_issuer_name()
    124.   #endif
    125.   
    126. > X509_NAME *X509_get_issuer_name(X509 *a)
    127.   	{
    128.   	return(a->cert_info->issuer);

crypto/x509/x509_cmp.c:128:2: 
    126.   X509_NAME *X509_get_issuer_name(X509 *a)
    127.   	{
    128. > 	return(a->cert_info->issuer);
    129.   	}
    130.   
