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


crypto/x509/x509_vfy.c:782:1: start of procedure check_cert()
780.   }
781.   
782. > static int check_cert(X509_STORE_CTX *ctx)
783.   {
784.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:784:5: 
782.   static int check_cert(X509_STORE_CTX *ctx)
783.   {
784. >     X509_CRL *crl = NULL, *dcrl = NULL;
785.       int ok = 0;
786.       int cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:785:5: 
783.   {
784.       X509_CRL *crl = NULL, *dcrl = NULL;
785. >     int ok = 0;
786.       int cnum = ctx->error_depth;
787.       X509 *x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:786:5: 
784.       X509_CRL *crl = NULL, *dcrl = NULL;
785.       int ok = 0;
786. >     int cnum = ctx->error_depth;
787.       X509 *x = sk_X509_value(ctx->chain, cnum);
788.   

crypto/x509/x509_vfy.c:787:5: 
785.       int ok = 0;
786.       int cnum = ctx->error_depth;
787. >     X509 *x = sk_X509_value(ctx->chain, cnum);
788.   
789.       ctx->current_cert = x;

include/openssl/x509.h:151:1: start of procedure sk_X509_value()
  149.   typedef struct x509_cinf_st X509_CINF;
  150.   
  151. > DEFINE_STACK_OF(X509)
  152.   
  153.   /* This is used for a table of trust checking functions */

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

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

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

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

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

include/openssl/x509.h:151:1: return from a call to sk_X509_value
  149.   typedef struct x509_cinf_st X509_CINF;
  150.   
  151. > DEFINE_STACK_OF(X509)
  152.   
  153.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:789:5: 
787.       X509 *x = sk_X509_value(ctx->chain, cnum);
788.   
789. >     ctx->current_cert = x;
790.       ctx->current_issuer = NULL;
791.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:790:5: 
788.   
789.       ctx->current_cert = x;
790. >     ctx->current_issuer = NULL;
791.       ctx->current_crl_score = 0;
792.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:791:5: 
789.       ctx->current_cert = x;
790.       ctx->current_issuer = NULL;
791. >     ctx->current_crl_score = 0;
792.       ctx->current_reasons = 0;
793.   

crypto/x509/x509_vfy.c:792:5: 
790.       ctx->current_issuer = NULL;
791.       ctx->current_crl_score = 0;
792. >     ctx->current_reasons = 0;
793.   
794.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:794:12: Loop condition is true. Entering loop body
792.       ctx->current_reasons = 0;
793.   
794.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
795.           unsigned int last_reasons = ctx->current_reasons;
796.   

crypto/x509/x509_vfy.c:795:9: 
793.   
794.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
795. >         unsigned int last_reasons = ctx->current_reasons;
796.   
797.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:798:13: Taking false branch
796.   
797.           /* Try to retrieve relevant CRL */
798.           if (ctx->get_crl)
                   ^
799.               ok = ctx->get_crl(ctx, &crl, x);
800.           else

crypto/x509/x509_vfy.c:801:13: 
799.               ok = ctx->get_crl(ctx, &crl, x);
800.           else
801. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
802.           /*
803.            * If error looking up CRL, nothing we can do except notify callback
