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


crypto/x509/x509_vfy.c:837:1: start of procedure check_cert()
835.   }
836.   
837. > static int check_cert(X509_STORE_CTX *ctx)
838.   {
839.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:839:5: 
837.   static int check_cert(X509_STORE_CTX *ctx)
838.   {
839. >     X509_CRL *crl = NULL, *dcrl = NULL;
840.       int ok = 0;
841.       int cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:840:5: 
838.   {
839.       X509_CRL *crl = NULL, *dcrl = NULL;
840. >     int ok = 0;
841.       int cnum = ctx->error_depth;
842.       X509 *x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:841:5: 
839.       X509_CRL *crl = NULL, *dcrl = NULL;
840.       int ok = 0;
841. >     int cnum = ctx->error_depth;
842.       X509 *x = sk_X509_value(ctx->chain, cnum);
843.   

crypto/x509/x509_vfy.c:842:5: 
840.       int ok = 0;
841.       int cnum = ctx->error_depth;
842. >     X509 *x = sk_X509_value(ctx->chain, cnum);
843.   
844.       ctx->current_cert = x;

include/openssl/x509.h:104:1: start of procedure sk_X509_value()
  102.   typedef struct x509_cinf_st X509_CINF;
  103.   
  104. > DEFINE_STACK_OF(X509)
  105.   
  106.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_value()
    275.   }
    276.   
    277. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    278.   {
    279.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:279:9: Taking false branch
    277.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    278.   {
    279.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    280.           return NULL;
    281.       return st->data[i];

crypto/stack/stack.c:279:23: Taking true branch
    277.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    278.   {
    279.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    280.           return NULL;
    281.       return st->data[i];

crypto/stack/stack.c:280:9: 
    278.   {
    279.       if (st == NULL || i < 0 || i >= st->num)
    280. >         return NULL;
    281.       return st->data[i];
    282.   }

crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_value
    280.           return NULL;
    281.       return st->data[i];
    282. > }
    283.   
    284.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value)

include/openssl/x509.h:104:1: return from a call to sk_X509_value
  102.   typedef struct x509_cinf_st X509_CINF;
  103.   
  104. > DEFINE_STACK_OF(X509)
  105.   
  106.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:844:5: 
842.       X509 *x = sk_X509_value(ctx->chain, cnum);
843.   
844. >     ctx->current_cert = x;
845.       ctx->current_issuer = NULL;
846.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:845:5: 
843.   
844.       ctx->current_cert = x;
845. >     ctx->current_issuer = NULL;
846.       ctx->current_crl_score = 0;
847.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:846:5: 
844.       ctx->current_cert = x;
845.       ctx->current_issuer = NULL;
846. >     ctx->current_crl_score = 0;
847.       ctx->current_reasons = 0;
848.   

crypto/x509/x509_vfy.c:847:5: 
845.       ctx->current_issuer = NULL;
846.       ctx->current_crl_score = 0;
847. >     ctx->current_reasons = 0;
848.   
849.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:849:12: Loop condition is true. Entering loop body
847.       ctx->current_reasons = 0;
848.   
849.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
850.           unsigned int last_reasons = ctx->current_reasons;
851.   

crypto/x509/x509_vfy.c:850:9: 
848.   
849.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
850. >         unsigned int last_reasons = ctx->current_reasons;
851.   
852.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:853:13: Taking false branch
851.   
852.           /* Try to retrieve relevant CRL */
853.           if (ctx->get_crl)
                   ^
854.               ok = ctx->get_crl(ctx, &crl, x);
855.           else

crypto/x509/x509_vfy.c:856:13: 
854.               ok = ctx->get_crl(ctx, &crl, x);
855.           else
856. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
857.           /*
858.            * If error looking up CRL, nothing we can do except notify callback
