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


crypto/x509/x509_vfy.c:878:1: start of procedure check_cert()
876.   }
877.   
878. > static int check_cert(X509_STORE_CTX *ctx)
879.   {
880.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:880:5: 
878.   static int check_cert(X509_STORE_CTX *ctx)
879.   {
880. >     X509_CRL *crl = NULL, *dcrl = NULL;
881.       X509 *x = NULL;
882.       int ok = 0, cnum = 0;

crypto/x509/x509_vfy.c:881:5: 
879.   {
880.       X509_CRL *crl = NULL, *dcrl = NULL;
881. >     X509 *x = NULL;
882.       int ok = 0, cnum = 0;
883.       unsigned int last_reasons = 0;

crypto/x509/x509_vfy.c:882:5: 
880.       X509_CRL *crl = NULL, *dcrl = NULL;
881.       X509 *x = NULL;
882. >     int ok = 0, cnum = 0;
883.       unsigned int last_reasons = 0;
884.       cnum = ctx->error_depth;

crypto/x509/x509_vfy.c:883:5: 
881.       X509 *x = NULL;
882.       int ok = 0, cnum = 0;
883. >     unsigned int last_reasons = 0;
884.       cnum = ctx->error_depth;
885.       x = sk_X509_value(ctx->chain, cnum);

crypto/x509/x509_vfy.c:884:5: 
882.       int ok = 0, cnum = 0;
883.       unsigned int last_reasons = 0;
884. >     cnum = ctx->error_depth;
885.       x = sk_X509_value(ctx->chain, cnum);
886.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:885:9: Condition is true
883.       unsigned int last_reasons = 0;
884.       cnum = ctx->error_depth;
885.       x = sk_X509_value(ctx->chain, cnum);
               ^
886.       ctx->current_cert = x;
887.       ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:885:5: 
883.       unsigned int last_reasons = 0;
884.       cnum = ctx->error_depth;
885. >     x = sk_X509_value(ctx->chain, cnum);
886.       ctx->current_cert = x;
887.       ctx->current_issuer = NULL;

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 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:28: 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)

crypto/x509/x509_vfy.c:886:5: 
884.       cnum = ctx->error_depth;
885.       x = sk_X509_value(ctx->chain, cnum);
886. >     ctx->current_cert = x;
887.       ctx->current_issuer = NULL;
888.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:887:5: 
885.       x = sk_X509_value(ctx->chain, cnum);
886.       ctx->current_cert = x;
887. >     ctx->current_issuer = NULL;
888.       ctx->current_crl_score = 0;
889.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:888:5: 
886.       ctx->current_cert = x;
887.       ctx->current_issuer = NULL;
888. >     ctx->current_crl_score = 0;
889.       ctx->current_reasons = 0;
890.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:889:5: 
887.       ctx->current_issuer = NULL;
888.       ctx->current_crl_score = 0;
889. >     ctx->current_reasons = 0;
890.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
891.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:890:12: Loop condition is true. Entering loop body
888.       ctx->current_crl_score = 0;
889.       ctx->current_reasons = 0;
890.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
891.           last_reasons = ctx->current_reasons;
892.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:891:9: 
889.       ctx->current_reasons = 0;
890.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
891. >         last_reasons = ctx->current_reasons;
892.           /* Try to retrieve relevant CRL */
893.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:893:13: Taking false branch
891.           last_reasons = ctx->current_reasons;
892.           /* Try to retrieve relevant CRL */
893.           if (ctx->get_crl)
                   ^
894.               ok = ctx->get_crl(ctx, &crl, x);
895.           else

crypto/x509/x509_vfy.c:896:13: 
894.               ok = ctx->get_crl(ctx, &crl, x);
895.           else
896. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
897.           /*
898.            * If error looking up CRL, nothing we can do except notify callback

crypto/x509/x509_vfy.c:1444:1: start of procedure get_crl_delta()
  1442.    */
  1443.   
  1444. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1445.                            X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1446.   {

crypto/x509/x509_vfy.c:1448:5: 
  1446.   {
  1447.       int ok;
  1448. >     X509 *issuer = NULL;
  1449.       int crl_score = 0;
  1450.       unsigned int reasons;

crypto/x509/x509_vfy.c:1449:5: 
  1447.       int ok;
  1448.       X509 *issuer = NULL;
  1449. >     int crl_score = 0;
  1450.       unsigned int reasons;
  1451.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1451:5: 
  1449.       int crl_score = 0;
  1450.       unsigned int reasons;
  1451. >     X509_CRL *crl = NULL, *dcrl = NULL;
  1452.       STACK_OF(X509_CRL) *skcrl;
  1453.       X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1453:5: 
  1451.       X509_CRL *crl = NULL, *dcrl = NULL;
  1452.       STACK_OF(X509_CRL) *skcrl;
  1453. >     X509_NAME *nm = X509_get_issuer_name(x);
  1454.       reasons = ctx->current_reasons;
  1455.       ok = get_crl_sk(ctx, &crl, &dcrl,

crypto/x509/x509_cmp.c:131:1: start of procedure X509_get_issuer_name()
    129.   }
    130.   
    131. > X509_NAME *X509_get_issuer_name(X509 *a)
    132.   {
    133.       return (a->cert_info.issuer);

crypto/x509/x509_cmp.c:133:5: 
    131.   X509_NAME *X509_get_issuer_name(X509 *a)
    132.   {
    133. >     return (a->cert_info.issuer);
    134.   }
    135.   
