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


crypto/x509/x509_vfy.c:742:1: start of procedure check_cert()
740.   }
741.   
742. > static int check_cert(X509_STORE_CTX *ctx)
743.   {
744.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:744:5: 
742.   static int check_cert(X509_STORE_CTX *ctx)
743.   {
744. >     X509_CRL *crl = NULL, *dcrl = NULL;
745.       X509 *x = NULL;
746.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:745:5: 
743.   {
744.       X509_CRL *crl = NULL, *dcrl = NULL;
745. >     X509 *x = NULL;
746.       int ok = 0, cnum = 0;
747.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:746:5: 
744.       X509_CRL *crl = NULL, *dcrl = NULL;
745.       X509 *x = NULL;
746. >     int ok = 0, cnum = 0;
747.       unsigned int last_reasons = 0;
748.       cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:747:5: 
745.       X509 *x = NULL;
746.       int ok = 0, cnum = 0;
747. >     unsigned int last_reasons = 0;
748.       cnum = ctx->error_depth;
749.       x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:748:5: 
746.       int ok = 0, cnum = 0;
747.       unsigned int last_reasons = 0;
748. >     cnum = ctx->error_depth;
749.       x = sk_X509_value(ctx->chain, cnum);
750.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:749:5: 
747.       unsigned int last_reasons = 0;
748.       cnum = ctx->error_depth;
749. >     x = sk_X509_value(ctx->chain, cnum);
750.       ctx->current_cert = x;
751.       ctx->current_issuer = NULL;

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:750:5: 
748.       cnum = ctx->error_depth;
749.       x = sk_X509_value(ctx->chain, cnum);
750. >     ctx->current_cert = x;
751.       ctx->current_issuer = NULL;
752.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:751:5: 
749.       x = sk_X509_value(ctx->chain, cnum);
750.       ctx->current_cert = x;
751. >     ctx->current_issuer = NULL;
752.       ctx->current_crl_score = 0;
753.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:752:5: 
750.       ctx->current_cert = x;
751.       ctx->current_issuer = NULL;
752. >     ctx->current_crl_score = 0;
753.       ctx->current_reasons = 0;
754.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:753:5: 
751.       ctx->current_issuer = NULL;
752.       ctx->current_crl_score = 0;
753. >     ctx->current_reasons = 0;
754.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
755.           last_reasons = ctx->current_reasons;

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

crypto/x509/x509_vfy.c:755:9: 
753.       ctx->current_reasons = 0;
754.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
755. >         last_reasons = ctx->current_reasons;
756.           /* Try to retrieve relevant CRL */
757.           if (ctx->get_crl)

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

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