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


crypto/x509/x509_vfy.c:724:1: start of procedure check_cert()
722.   	}
723.   
724. > static int check_cert(X509_STORE_CTX *ctx)
725.   	{
726.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:726:2: 
724.   static int check_cert(X509_STORE_CTX *ctx)
725.   	{
726. > 	X509_CRL *crl = NULL, *dcrl = NULL;
727.   	X509 *x;
728.   	int ok, cnum;

crypto/x509/x509_vfy.c:729:2: 
727.   	X509 *x;
728.   	int ok, cnum;
729. > 	cnum = ctx->error_depth;
730.   	x = sk_X509_value(ctx->chain, cnum);
731.   	ctx->current_cert = x;

crypto/x509/x509_vfy.c:730:6: Condition is true
728.   	int ok, cnum;
729.   	cnum = ctx->error_depth;
730.   	x = sk_X509_value(ctx->chain, cnum);
            ^
731.   	ctx->current_cert = x;
732.   	ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:730:2: 
728.   	int ok, cnum;
729.   	cnum = ctx->error_depth;
730. > 	x = sk_X509_value(ctx->chain, cnum);
731.   	ctx->current_cert = x;
732.   	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:731:2: 
729.   	cnum = ctx->error_depth;
730.   	x = sk_X509_value(ctx->chain, cnum);
731. > 	ctx->current_cert = x;
732.   	ctx->current_issuer = NULL;
733.   	ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:732:2: 
730.   	x = sk_X509_value(ctx->chain, cnum);
731.   	ctx->current_cert = x;
732. > 	ctx->current_issuer = NULL;
733.   	ctx->current_reasons = 0;
734.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)

crypto/x509/x509_vfy.c:733:2: 
731.   	ctx->current_cert = x;
732.   	ctx->current_issuer = NULL;
733. > 	ctx->current_reasons = 0;
734.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
735.   		{

crypto/x509/x509_vfy.c:734:9: Loop condition is true. Entering loop body
732.   	ctx->current_issuer = NULL;
733.   	ctx->current_reasons = 0;
734.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
               ^
735.   		{
736.   		/* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:737:7: Taking false branch
735.   		{
736.   		/* Try to retrieve relevant CRL */
737.   		if (ctx->get_crl)
             ^
738.   			ok = ctx->get_crl(ctx, &crl, x);
739.   		else

crypto/x509/x509_vfy.c:740:4: 
738.   			ok = ctx->get_crl(ctx, &crl, x);
739.   		else
740. > 			ok = get_crl_delta(ctx, &crl, &dcrl, x);
741.   		/* If error looking up CRL, nothing we can do except
742.   		 * notify callback

crypto/x509/x509_vfy.c:1323:1: start of procedure get_crl_delta()
  1321.    */
  1322.   	
  1323. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1324.   				X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1325.   	{

crypto/x509/x509_vfy.c:1327:2: 
  1325.   	{
  1326.   	int ok;
  1327. > 	X509 *issuer = NULL;
  1328.   	int crl_score = 0;
  1329.   	unsigned int reasons;

crypto/x509/x509_vfy.c:1328:2: 
  1326.   	int ok;
  1327.   	X509 *issuer = NULL;
  1328. > 	int crl_score = 0;
  1329.   	unsigned int reasons;
  1330.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1330:2: 
  1328.   	int crl_score = 0;
  1329.   	unsigned int reasons;
  1330. > 	X509_CRL *crl = NULL, *dcrl = NULL;
  1331.   	STACK_OF(X509_CRL) *skcrl;
  1332.   	X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1332:2: 
  1330.   	X509_CRL *crl = NULL, *dcrl = NULL;
  1331.   	STACK_OF(X509_CRL) *skcrl;
  1332. > 	X509_NAME *nm = X509_get_issuer_name(x);
  1333.   	reasons = ctx->current_reasons;
  1334.   	ok = get_crl_sk(ctx, &crl, &dcrl, 

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

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