crypto/x509/x509_vfy.c:710: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 699 could be null and is dereferenced by call to `get_crl_delta()` at line 710, column 18.
Showing all 22 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:5: 
692.   static int check_cert(X509_STORE_CTX *ctx)
693.   {
694. >     X509_CRL *crl = NULL, *dcrl = NULL;
695.       X509 *x = NULL;
696.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:695:5: 
693.   {
694.       X509_CRL *crl = NULL, *dcrl = NULL;
695. >     X509 *x = NULL;
696.       int ok = 0, cnum = 0;
697.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:696:5: 
694.       X509_CRL *crl = NULL, *dcrl = NULL;
695.       X509 *x = NULL;
696. >     int ok = 0, cnum = 0;
697.       unsigned int last_reasons = 0;
698.       cnum = ctx->error_depth;

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

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

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

include/openssl/x509.h:170:1: start of procedure sk_X509_value()
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:324:1: start of procedure sk_value()
    322.   }
    323.   
    324. > void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:326:10: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                    ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:17: Taking true branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                           ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:327:9: 
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
    327. >         return NULL;
    328.       return st->data[i];
    329.   }

crypto/stack/stack.c:329:1: return from a call to sk_value
    327.           return NULL;
    328.       return st->data[i];
    329. > }
    330.   
    331.   void *sk_set(_STACK *st, int i, void *value)

include/openssl/x509.h:170:1: return from a call to sk_X509_value
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

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

crypto/x509/x509_vfy.c:701:5: 
699.       x = sk_X509_value(ctx->chain, cnum);
700.       ctx->current_cert = x;
701. >     ctx->current_issuer = NULL;
702.       ctx->current_crl_score = 0;
703.       ctx->current_reasons = 0;

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

crypto/x509/x509_vfy.c:703:5: 
701.       ctx->current_issuer = NULL;
702.       ctx->current_crl_score = 0;
703. >     ctx->current_reasons = 0;
704.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
705.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:704:12: Loop condition is true. Entering loop body
702.       ctx->current_crl_score = 0;
703.       ctx->current_reasons = 0;
704.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
705.           last_reasons = ctx->current_reasons;
706.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:705:9: 
703.       ctx->current_reasons = 0;
704.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
705. >         last_reasons = ctx->current_reasons;
706.           /* Try to retrieve relevant CRL */
707.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:707:13: Taking false branch
705.           last_reasons = ctx->current_reasons;
706.           /* Try to retrieve relevant CRL */
707.           if (ctx->get_crl)
                   ^
708.               ok = ctx->get_crl(ctx, &crl, x);
709.           else

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