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


crypto/x509/x509_vfy.c:738:1: start of procedure check_cert()
736.   }
737.   
738. > static int check_cert(X509_STORE_CTX *ctx)
739.   {
740.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:740:5: 
738.   static int check_cert(X509_STORE_CTX *ctx)
739.   {
740. >     X509_CRL *crl = NULL, *dcrl = NULL;
741.       X509 *x = NULL;
742.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:741:5: 
739.   {
740.       X509_CRL *crl = NULL, *dcrl = NULL;
741. >     X509 *x = NULL;
742.       int ok = 0, cnum = 0;
743.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:742:5: 
740.       X509_CRL *crl = NULL, *dcrl = NULL;
741.       X509 *x = NULL;
742. >     int ok = 0, cnum = 0;
743.       unsigned int last_reasons = 0;
744.       cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:743:5: 
741.       X509 *x = NULL;
742.       int ok = 0, cnum = 0;
743. >     unsigned int last_reasons = 0;
744.       cnum = ctx->error_depth;
745.       x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:744:5: 
742.       int ok = 0, cnum = 0;
743.       unsigned int last_reasons = 0;
744. >     cnum = ctx->error_depth;
745.       x = sk_X509_value(ctx->chain, cnum);
746.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:745:5: 
743.       unsigned int last_reasons = 0;
744.       cnum = ctx->error_depth;
745. >     x = sk_X509_value(ctx->chain, cnum);
746.       ctx->current_cert = x;
747.       ctx->current_issuer = NULL;

include/openssl/x509.h:169:1: start of procedure sk_X509_value()
  167.   typedef struct x509_cinf_st X509_CINF;
  168.   
  169. > DEFINE_STACK_OF(X509)
  170.   
  171.   /* 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:169:1: return from a call to sk_X509_value
  167.   typedef struct x509_cinf_st X509_CINF;
  168.   
  169. > DEFINE_STACK_OF(X509)
  170.   
  171.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:746:5: 
744.       cnum = ctx->error_depth;
745.       x = sk_X509_value(ctx->chain, cnum);
746. >     ctx->current_cert = x;
747.       ctx->current_issuer = NULL;
748.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:747:5: 
745.       x = sk_X509_value(ctx->chain, cnum);
746.       ctx->current_cert = x;
747. >     ctx->current_issuer = NULL;
748.       ctx->current_crl_score = 0;
749.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:748:5: 
746.       ctx->current_cert = x;
747.       ctx->current_issuer = NULL;
748. >     ctx->current_crl_score = 0;
749.       ctx->current_reasons = 0;
750.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:749:5: 
747.       ctx->current_issuer = NULL;
748.       ctx->current_crl_score = 0;
749. >     ctx->current_reasons = 0;
750.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
751.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:750:12: Loop condition is true. Entering loop body
748.       ctx->current_crl_score = 0;
749.       ctx->current_reasons = 0;
750.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
751.           last_reasons = ctx->current_reasons;
752.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:751:9: 
749.       ctx->current_reasons = 0;
750.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
751. >         last_reasons = ctx->current_reasons;
752.           /* Try to retrieve relevant CRL */
753.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:753:13: Taking false branch
751.           last_reasons = ctx->current_reasons;
752.           /* Try to retrieve relevant CRL */
753.           if (ctx->get_crl)
                   ^
754.               ok = ctx->get_crl(ctx, &crl, x);
755.           else

crypto/x509/x509_vfy.c:756:13: 
754.               ok = ctx->get_crl(ctx, &crl, x);
755.           else
756. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
757.           /*
758.            * If error looking up CRL, nothing we can do except notify callback
