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


crypto/x509/x509_vfy.c:712:1: start of procedure check_cert()
710.   }
711.   
712. > static int check_cert(X509_STORE_CTX *ctx)
713.   {
714.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:714:5: 
712.   static int check_cert(X509_STORE_CTX *ctx)
713.   {
714. >     X509_CRL *crl = NULL, *dcrl = NULL;
715.       X509 *x = NULL;
716.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:715:5: 
713.   {
714.       X509_CRL *crl = NULL, *dcrl = NULL;
715. >     X509 *x = NULL;
716.       int ok = 0, cnum = 0;
717.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:716:5: 
714.       X509_CRL *crl = NULL, *dcrl = NULL;
715.       X509 *x = NULL;
716. >     int ok = 0, cnum = 0;
717.       unsigned int last_reasons = 0;
718.       cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:717:5: 
715.       X509 *x = NULL;
716.       int ok = 0, cnum = 0;
717. >     unsigned int last_reasons = 0;
718.       cnum = ctx->error_depth;
719.       x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:718:5: 
716.       int ok = 0, cnum = 0;
717.       unsigned int last_reasons = 0;
718. >     cnum = ctx->error_depth;
719.       x = sk_X509_value(ctx->chain, cnum);
720.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:719:5: 
717.       unsigned int last_reasons = 0;
718.       cnum = ctx->error_depth;
719. >     x = sk_X509_value(ctx->chain, cnum);
720.       ctx->current_cert = x;
721.       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:720:5: 
718.       cnum = ctx->error_depth;
719.       x = sk_X509_value(ctx->chain, cnum);
720. >     ctx->current_cert = x;
721.       ctx->current_issuer = NULL;
722.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:721:5: 
719.       x = sk_X509_value(ctx->chain, cnum);
720.       ctx->current_cert = x;
721. >     ctx->current_issuer = NULL;
722.       ctx->current_crl_score = 0;
723.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:722:5: 
720.       ctx->current_cert = x;
721.       ctx->current_issuer = NULL;
722. >     ctx->current_crl_score = 0;
723.       ctx->current_reasons = 0;
724.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:723:5: 
721.       ctx->current_issuer = NULL;
722.       ctx->current_crl_score = 0;
723. >     ctx->current_reasons = 0;
724.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
725.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:724:12: Loop condition is true. Entering loop body
722.       ctx->current_crl_score = 0;
723.       ctx->current_reasons = 0;
724.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
725.           last_reasons = ctx->current_reasons;
726.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:725:9: 
723.       ctx->current_reasons = 0;
724.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
725. >         last_reasons = ctx->current_reasons;
726.           /* Try to retrieve relevant CRL */
727.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:727:13: Taking false branch
725.           last_reasons = ctx->current_reasons;
726.           /* Try to retrieve relevant CRL */
727.           if (ctx->get_crl)
                   ^
728.               ok = ctx->get_crl(ctx, &crl, x);
729.           else

crypto/x509/x509_vfy.c:730:13: 
728.               ok = ctx->get_crl(ctx, &crl, x);
729.           else
730. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
731.           /*
732.            * If error looking up CRL, nothing we can do except notify callback
