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


crypto/x509/x509_vfy.c:831:1: start of procedure check_cert()
829.   }
830.   
831. > static int check_cert(X509_STORE_CTX *ctx)
832.   {
833.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:833:5: 
831.   static int check_cert(X509_STORE_CTX *ctx)
832.   {
833. >     X509_CRL *crl = NULL, *dcrl = NULL;
834.       int ok = 0;
835.       int cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:834:5: 
832.   {
833.       X509_CRL *crl = NULL, *dcrl = NULL;
834. >     int ok = 0;
835.       int cnum = ctx->error_depth;
836.       X509 *x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:835:5: 
833.       X509_CRL *crl = NULL, *dcrl = NULL;
834.       int ok = 0;
835. >     int cnum = ctx->error_depth;
836.       X509 *x = sk_X509_value(ctx->chain, cnum);
837.   

crypto/x509/x509_vfy.c:836:5: 
834.       int ok = 0;
835.       int cnum = ctx->error_depth;
836. >     X509 *x = sk_X509_value(ctx->chain, cnum);
837.   
838.       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:272:1: start of procedure OPENSSL_sk_value()
    270.   }
    271.   
    272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:274:9: Taking false branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:274:23: Taking true branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:275:9: 
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
    275. >         return NULL;
    276.       return st->data[i];
    277.   }

crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value
    275.           return NULL;
    276.       return st->data[i];
    277. > }
    278.   
    279.   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:838:5: 
836.       X509 *x = sk_X509_value(ctx->chain, cnum);
837.   
838. >     ctx->current_cert = x;
839.       ctx->current_issuer = NULL;
840.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:839:5: 
837.   
838.       ctx->current_cert = x;
839. >     ctx->current_issuer = NULL;
840.       ctx->current_crl_score = 0;
841.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:840:5: 
838.       ctx->current_cert = x;
839.       ctx->current_issuer = NULL;
840. >     ctx->current_crl_score = 0;
841.       ctx->current_reasons = 0;
842.   

crypto/x509/x509_vfy.c:841:5: 
839.       ctx->current_issuer = NULL;
840.       ctx->current_crl_score = 0;
841. >     ctx->current_reasons = 0;
842.   
843.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:843:12: Loop condition is true. Entering loop body
841.       ctx->current_reasons = 0;
842.   
843.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
844.           unsigned int last_reasons = ctx->current_reasons;
845.   

crypto/x509/x509_vfy.c:844:9: 
842.   
843.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
844. >         unsigned int last_reasons = ctx->current_reasons;
845.   
846.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:847:13: Taking false branch
845.   
846.           /* Try to retrieve relevant CRL */
847.           if (ctx->get_crl)
                   ^
848.               ok = ctx->get_crl(ctx, &crl, x);
849.           else

crypto/x509/x509_vfy.c:850:13: 
848.               ok = ctx->get_crl(ctx, &crl, x);
849.           else
850. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
851.           /*
852.            * If error looking up CRL, nothing we can do except notify callback
