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


crypto/x509/x509_vfy.c:717:1: start of procedure check_cert()
715.   }
716.   
717. > static int check_cert(X509_STORE_CTX *ctx)
718.   {
719.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:719:5: 
717.   static int check_cert(X509_STORE_CTX *ctx)
718.   {
719. >     X509_CRL *crl = NULL, *dcrl = NULL;
720.       X509 *x = NULL;
721.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:720:5: 
718.   {
719.       X509_CRL *crl = NULL, *dcrl = NULL;
720. >     X509 *x = NULL;
721.       int ok = 0, cnum = 0;
722.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:721:5: 
719.       X509_CRL *crl = NULL, *dcrl = NULL;
720.       X509 *x = NULL;
721. >     int ok = 0, cnum = 0;
722.       unsigned int last_reasons = 0;
723.       cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:722:5: 
720.       X509 *x = NULL;
721.       int ok = 0, cnum = 0;
722. >     unsigned int last_reasons = 0;
723.       cnum = ctx->error_depth;
724.       x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:723:5: 
721.       int ok = 0, cnum = 0;
722.       unsigned int last_reasons = 0;
723. >     cnum = ctx->error_depth;
724.       x = sk_X509_value(ctx->chain, cnum);
725.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:724:5: 
722.       unsigned int last_reasons = 0;
723.       cnum = ctx->error_depth;
724. >     x = sk_X509_value(ctx->chain, cnum);
725.       ctx->current_cert = x;
726.       ctx->current_issuer = NULL;

include/openssl/x509.h:170:1: start of procedure sk_X509_value()
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

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

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

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

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

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

include/openssl/x509.h:170:1: return from a call to sk_X509_value
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:725:5: 
723.       cnum = ctx->error_depth;
724.       x = sk_X509_value(ctx->chain, cnum);
725. >     ctx->current_cert = x;
726.       ctx->current_issuer = NULL;
727.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:726:5: 
724.       x = sk_X509_value(ctx->chain, cnum);
725.       ctx->current_cert = x;
726. >     ctx->current_issuer = NULL;
727.       ctx->current_crl_score = 0;
728.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:727:5: 
725.       ctx->current_cert = x;
726.       ctx->current_issuer = NULL;
727. >     ctx->current_crl_score = 0;
728.       ctx->current_reasons = 0;
729.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:728:5: 
726.       ctx->current_issuer = NULL;
727.       ctx->current_crl_score = 0;
728. >     ctx->current_reasons = 0;
729.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
730.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:729:12: Loop condition is true. Entering loop body
727.       ctx->current_crl_score = 0;
728.       ctx->current_reasons = 0;
729.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
730.           last_reasons = ctx->current_reasons;
731.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:730:9: 
728.       ctx->current_reasons = 0;
729.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
730. >         last_reasons = ctx->current_reasons;
731.           /* Try to retrieve relevant CRL */
732.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:732:13: Taking false branch
730.           last_reasons = ctx->current_reasons;
731.           /* Try to retrieve relevant CRL */
732.           if (ctx->get_crl)
                   ^
733.               ok = ctx->get_crl(ctx, &crl, x);
734.           else

crypto/x509/x509_vfy.c:735:13: 
733.               ok = ctx->get_crl(ctx, &crl, x);
734.           else
735. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
736.           /*
737.            * If error looking up CRL, nothing we can do except notify callback
