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


crypto/x509/x509_vfy.c:750:1: start of procedure check_cert()
748.   }
749.   
750. > static int check_cert(X509_STORE_CTX *ctx)
751.   {
752.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:752:5: 
750.   static int check_cert(X509_STORE_CTX *ctx)
751.   {
752. >     X509_CRL *crl = NULL, *dcrl = NULL;
753.       X509 *x = NULL;
754.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:753:5: 
751.   {
752.       X509_CRL *crl = NULL, *dcrl = NULL;
753. >     X509 *x = NULL;
754.       int ok = 0, cnum = 0;
755.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:754:5: 
752.       X509_CRL *crl = NULL, *dcrl = NULL;
753.       X509 *x = NULL;
754. >     int ok = 0, cnum = 0;
755.       unsigned int last_reasons = 0;
756.       cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:755:5: 
753.       X509 *x = NULL;
754.       int ok = 0, cnum = 0;
755. >     unsigned int last_reasons = 0;
756.       cnum = ctx->error_depth;
757.       x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:756:5: 
754.       int ok = 0, cnum = 0;
755.       unsigned int last_reasons = 0;
756. >     cnum = ctx->error_depth;
757.       x = sk_X509_value(ctx->chain, cnum);
758.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:757:5: 
755.       unsigned int last_reasons = 0;
756.       cnum = ctx->error_depth;
757. >     x = sk_X509_value(ctx->chain, cnum);
758.       ctx->current_cert = x;
759.       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:758:5: 
756.       cnum = ctx->error_depth;
757.       x = sk_X509_value(ctx->chain, cnum);
758. >     ctx->current_cert = x;
759.       ctx->current_issuer = NULL;
760.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:759:5: 
757.       x = sk_X509_value(ctx->chain, cnum);
758.       ctx->current_cert = x;
759. >     ctx->current_issuer = NULL;
760.       ctx->current_crl_score = 0;
761.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:760:5: 
758.       ctx->current_cert = x;
759.       ctx->current_issuer = NULL;
760. >     ctx->current_crl_score = 0;
761.       ctx->current_reasons = 0;
762.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:761:5: 
759.       ctx->current_issuer = NULL;
760.       ctx->current_crl_score = 0;
761. >     ctx->current_reasons = 0;
762.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
763.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:762:12: Loop condition is true. Entering loop body
760.       ctx->current_crl_score = 0;
761.       ctx->current_reasons = 0;
762.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
763.           last_reasons = ctx->current_reasons;
764.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:763:9: 
761.       ctx->current_reasons = 0;
762.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
763. >         last_reasons = ctx->current_reasons;
764.           /* Try to retrieve relevant CRL */
765.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:765:13: Taking false branch
763.           last_reasons = ctx->current_reasons;
764.           /* Try to retrieve relevant CRL */
765.           if (ctx->get_crl)
                   ^
766.               ok = ctx->get_crl(ctx, &crl, x);
767.           else

crypto/x509/x509_vfy.c:768:13: 
766.               ok = ctx->get_crl(ctx, &crl, x);
767.           else
768. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
769.           /*
770.            * If error looking up CRL, nothing we can do except notify callback
