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


crypto/x509/x509_vfy.c:753:1: start of procedure check_cert()
751.   	}
752.   
753. > static int check_cert(X509_STORE_CTX *ctx)
754.   	{
755.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:755:2: 
753.   static int check_cert(X509_STORE_CTX *ctx)
754.   	{
755. > 	X509_CRL *crl = NULL, *dcrl = NULL;
756.   	X509 *x;
757.   	int ok, cnum;

crypto/x509/x509_vfy.c:758:2: 
756.   	X509 *x;
757.   	int ok, cnum;
758. > 	cnum = ctx->error_depth;
759.   	x = sk_X509_value(ctx->chain, cnum);
760.   	ctx->current_cert = x;

crypto/x509/x509_vfy.c:759:6: Condition is true
757.   	int ok, cnum;
758.   	cnum = ctx->error_depth;
759.   	x = sk_X509_value(ctx->chain, cnum);
            ^
760.   	ctx->current_cert = x;
761.   	ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:759:2: 
757.   	int ok, cnum;
758.   	cnum = ctx->error_depth;
759. > 	x = sk_X509_value(ctx->chain, cnum);
760.   	ctx->current_cert = x;
761.   	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:760:2: 
758.   	cnum = ctx->error_depth;
759.   	x = sk_X509_value(ctx->chain, cnum);
760. > 	ctx->current_cert = x;
761.   	ctx->current_issuer = NULL;
762.   	ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:761:2: 
759.   	x = sk_X509_value(ctx->chain, cnum);
760.   	ctx->current_cert = x;
761. > 	ctx->current_issuer = NULL;
762.   	ctx->current_crl_score = 0;
763.   	ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:762:2: 
760.   	ctx->current_cert = x;
761.   	ctx->current_issuer = NULL;
762. > 	ctx->current_crl_score = 0;
763.   	ctx->current_reasons = 0;
764.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)

crypto/x509/x509_vfy.c:763:2: 
761.   	ctx->current_issuer = NULL;
762.   	ctx->current_crl_score = 0;
763. > 	ctx->current_reasons = 0;
764.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
765.   		{

crypto/x509/x509_vfy.c:764:9: Loop condition is true. Entering loop body
762.   	ctx->current_crl_score = 0;
763.   	ctx->current_reasons = 0;
764.   	while (ctx->current_reasons != CRLDP_ALL_REASONS)
               ^
765.   		{
766.   		/* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:767:7: Taking false branch
765.   		{
766.   		/* Try to retrieve relevant CRL */
767.   		if (ctx->get_crl)
             ^
768.   			ok = ctx->get_crl(ctx, &crl, x);
769.   		else

crypto/x509/x509_vfy.c:770:4: 
768.   			ok = ctx->get_crl(ctx, &crl, x);
769.   		else
770. > 			ok = get_crl_delta(ctx, &crl, &dcrl, x);
771.   		/* If error looking up CRL, nothing we can do except
772.   		 * notify callback

crypto/x509/x509_vfy.c:1353:1: start of procedure get_crl_delta()
  1351.    */
  1352.   	
  1353. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1354.   				X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1355.   	{

crypto/x509/x509_vfy.c:1357:2: 
  1355.   	{
  1356.   	int ok;
  1357. > 	X509 *issuer = NULL;
  1358.   	int crl_score = 0;
  1359.   	unsigned int reasons;

crypto/x509/x509_vfy.c:1358:2: 
  1356.   	int ok;
  1357.   	X509 *issuer = NULL;
  1358. > 	int crl_score = 0;
  1359.   	unsigned int reasons;
  1360.   	X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1360:2: 
  1358.   	int crl_score = 0;
  1359.   	unsigned int reasons;
  1360. > 	X509_CRL *crl = NULL, *dcrl = NULL;
  1361.   	STACK_OF(X509_CRL) *skcrl;
  1362.   	X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1362:2: 
  1360.   	X509_CRL *crl = NULL, *dcrl = NULL;
  1361.   	STACK_OF(X509_CRL) *skcrl;
  1362. > 	X509_NAME *nm = X509_get_issuer_name(x);
  1363.   	reasons = ctx->current_reasons;
  1364.   	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.   
