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


crypto/x509/x509_vfy.c:845:1: start of procedure check_cert()
843.   	}
844.   
845. > static int check_cert(X509_STORE_CTX *ctx)
846.   	{
847.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:847:2: 
845.   static int check_cert(X509_STORE_CTX *ctx)
846.   	{
847. > 	X509_CRL *crl = NULL, *dcrl = NULL;
848.   	X509 *x;
849.   	int ok, cnum;

crypto/x509/x509_vfy.c:851:2: 
849.   	int ok, cnum;
850.   	unsigned int last_reasons;
851. > 	cnum = ctx->error_depth;
852.   	x = sk_X509_value(ctx->chain, cnum);
853.   	ctx->current_cert = x;

crypto/x509/x509_vfy.c:852:6: Condition is true
850.   	unsigned int last_reasons;
851.   	cnum = ctx->error_depth;
852.   	x = sk_X509_value(ctx->chain, cnum);
            ^
853.   	ctx->current_cert = x;
854.   	ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:852:2: 
850.   	unsigned int last_reasons;
851.   	cnum = ctx->error_depth;
852. > 	x = sk_X509_value(ctx->chain, cnum);
853.   	ctx->current_cert = x;
854.   	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:853:2: 
851.   	cnum = ctx->error_depth;
852.   	x = sk_X509_value(ctx->chain, cnum);
853. > 	ctx->current_cert = x;
854.   	ctx->current_issuer = NULL;
855.   	ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:854:2: 
852.   	x = sk_X509_value(ctx->chain, cnum);
853.   	ctx->current_cert = x;
854. > 	ctx->current_issuer = NULL;
855.   	ctx->current_crl_score = 0;
856.   	ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:855:2: 
853.   	ctx->current_cert = x;
854.   	ctx->current_issuer = NULL;
855. > 	ctx->current_crl_score = 0;
856.   	ctx->current_reasons = 0;
857.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)

crypto/x509/x509_vfy.c:856:2: 
854.   	ctx->current_issuer = NULL;
855.   	ctx->current_crl_score = 0;
856. > 	ctx->current_reasons = 0;
857.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
858.   		{

crypto/x509/x509_vfy.c:857:9: Loop condition is true. Entering loop body
855.   	ctx->current_crl_score = 0;
856.   	ctx->current_reasons = 0;
857.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
               ^
858.   		{
859.   		last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:859:3: 
857.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
858.   		{
859. > 		last_reasons = ctx->current_reasons;
860.   		/* Try to retrieve relevant CRL */
861.   		if (ctx->get_crl)

crypto/x509/x509_vfy.c:861:7: Taking false branch
859.   		last_reasons = ctx->current_reasons;
860.   		/* Try to retrieve relevant CRL */
861.   		if (ctx->get_crl)
             ^
862.   			ok = ctx->get_crl(ctx, &crl, x);
863.   		else

crypto/x509/x509_vfy.c:864:4: 
862.   			ok = ctx->get_crl(ctx, &crl, x);
863.   		else
864. > 			ok = get_crl_delta(ctx, &crl, &dcrl, x);
865.   		/* If error looking up CRL, nothing we can do except
866.   		 * notify callback

crypto/x509/x509_vfy.c:1456:1: start of procedure get_crl_delta()
  1454.    */
  1455.   	
  1456. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1457.   				X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1458.   	{

crypto/x509/x509_vfy.c:1460:2: 
  1458.   	{
  1459.   	int ok;
  1460. > 	X509 *issuer = NULL;
  1461.   	int crl_score = 0;
  1462.   	unsigned int reasons;

crypto/x509/x509_vfy.c:1461:2: 
  1459.   	int ok;
  1460.   	X509 *issuer = NULL;
  1461. > 	int crl_score = 0;
  1462.   	unsigned int reasons;
  1463.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1463:2: 
  1461.   	int crl_score = 0;
  1462.   	unsigned int reasons;
  1463. > 	X509_CRL *crl = NULL, *dcrl = NULL;
  1464.   	STACK_OF(X509_CRL) *skcrl;
  1465.   	X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1465:2: 
  1463.   	X509_CRL *crl = NULL, *dcrl = NULL;
  1464.   	STACK_OF(X509_CRL) *skcrl;
  1465. > 	X509_NAME *nm = X509_get_issuer_name(x);
  1466.   	reasons = ctx->current_reasons;
  1467.   	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.   
