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


crypto/x509/x509_vfy.c:834:1: start of procedure check_cert()
832.   }
833.   
834. > static int check_cert(X509_STORE_CTX *ctx)
835.   {
836.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:836:5: 
834.   static int check_cert(X509_STORE_CTX *ctx)
835.   {
836. >     X509_CRL *crl = NULL, *dcrl = NULL;
837.       X509 *x;
838.       int ok, cnum;

crypto/x509/x509_vfy.c:840:5: 
838.       int ok, cnum;
839.       unsigned int last_reasons;
840. >     cnum = ctx->error_depth;
841.       x = sk_X509_value(ctx->chain, cnum);
842.       ctx->current_cert = x;

crypto/x509/x509_vfy.c:841:9: Condition is true
839.       unsigned int last_reasons;
840.       cnum = ctx->error_depth;
841.       x = sk_X509_value(ctx->chain, cnum);
               ^
842.       ctx->current_cert = x;
843.       ctx->current_issuer = NULL;

crypto/x509/x509_vfy.c:841:5: 
839.       unsigned int last_reasons;
840.       cnum = ctx->error_depth;
841. >     x = sk_X509_value(ctx->chain, cnum);
842.       ctx->current_cert = x;
843.       ctx->current_issuer = NULL;

crypto/stack/stack.c:347:1: start of procedure sk_value()
  345.   }
  346.   
  347. > void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                  ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                         ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking true branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:350:9: 
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
  350. >         return NULL;
  351.       return st->data[i];
  352.   }

crypto/stack/stack.c:352:1: return from a call to sk_value
  350.           return NULL;
  351.       return st->data[i];
  352. > }
  353.   
  354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:842:5: 
840.       cnum = ctx->error_depth;
841.       x = sk_X509_value(ctx->chain, cnum);
842. >     ctx->current_cert = x;
843.       ctx->current_issuer = NULL;
844.       ctx->current_crl_score = 0;

crypto/x509/x509_vfy.c:843:5: 
841.       x = sk_X509_value(ctx->chain, cnum);
842.       ctx->current_cert = x;
843. >     ctx->current_issuer = NULL;
844.       ctx->current_crl_score = 0;
845.       ctx->current_reasons = 0;

crypto/x509/x509_vfy.c:844:5: 
842.       ctx->current_cert = x;
843.       ctx->current_issuer = NULL;
844. >     ctx->current_crl_score = 0;
845.       ctx->current_reasons = 0;
846.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {

crypto/x509/x509_vfy.c:845:5: 
843.       ctx->current_issuer = NULL;
844.       ctx->current_crl_score = 0;
845. >     ctx->current_reasons = 0;
846.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
847.           last_reasons = ctx->current_reasons;

crypto/x509/x509_vfy.c:846:12: Loop condition is true. Entering loop body
844.       ctx->current_crl_score = 0;
845.       ctx->current_reasons = 0;
846.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
                  ^
847.           last_reasons = ctx->current_reasons;
848.           /* Try to retrieve relevant CRL */

crypto/x509/x509_vfy.c:847:9: 
845.       ctx->current_reasons = 0;
846.       while (ctx->current_reasons != CRLDP_ALL_REASONS) {
847. >         last_reasons = ctx->current_reasons;
848.           /* Try to retrieve relevant CRL */
849.           if (ctx->get_crl)

crypto/x509/x509_vfy.c:849:13: Taking false branch
847.           last_reasons = ctx->current_reasons;
848.           /* Try to retrieve relevant CRL */
849.           if (ctx->get_crl)
                   ^
850.               ok = ctx->get_crl(ctx, &crl, x);
851.           else

crypto/x509/x509_vfy.c:852:13: 
850.               ok = ctx->get_crl(ctx, &crl, x);
851.           else
852. >             ok = get_crl_delta(ctx, &crl, &dcrl, x);
853.           /*
854.            * If error looking up CRL, nothing we can do except notify callback

crypto/x509/x509_vfy.c:1401:1: start of procedure get_crl_delta()
  1399.    */
  1400.   
  1401. > static int get_crl_delta(X509_STORE_CTX *ctx,
  1402.                            X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
  1403.   {

crypto/x509/x509_vfy.c:1405:5: 
  1403.   {
  1404.       int ok;
  1405. >     X509 *issuer = NULL;
  1406.       int crl_score = 0;
  1407.       unsigned int reasons;

crypto/x509/x509_vfy.c:1406:5: 
  1404.       int ok;
  1405.       X509 *issuer = NULL;
  1406. >     int crl_score = 0;
  1407.       unsigned int reasons;
  1408.       X509_CRL *crl = NULL, *dcrl = NULL;

crypto/x509/x509_vfy.c:1408:5: 
  1406.       int crl_score = 0;
  1407.       unsigned int reasons;
  1408. >     X509_CRL *crl = NULL, *dcrl = NULL;
  1409.       STACK_OF(X509_CRL) *skcrl;
  1410.       X509_NAME *nm = X509_get_issuer_name(x);

crypto/x509/x509_vfy.c:1410:5: 
  1408.       X509_CRL *crl = NULL, *dcrl = NULL;
  1409.       STACK_OF(X509_CRL) *skcrl;
  1410. >     X509_NAME *nm = X509_get_issuer_name(x);
  1411.       reasons = ctx->current_reasons;
  1412.       ok = get_crl_sk(ctx, &crl, &dcrl,

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

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