crypto/x509/x509_vfy.c:1188: error: NULL_DEREFERENCE
  pointer `crl_issuer` last assigned on line 1187 could be null and is dereferenced by call to `X509_get_subject_name()` at line 1188, column 27.
Showing all 52 steps of the trace


crypto/x509/x509_vfy.c:1165:1: start of procedure crl_akid_check()
1163.   }
1164.   
1165. > static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,
1166.                              X509 **pissuer, int *pcrl_score)
1167.   {

crypto/x509/x509_vfy.c:1168:5: 
1166.                              X509 **pissuer, int *pcrl_score)
1167.   {
1168. >     X509 *crl_issuer = NULL;
1169.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1170.       int cidx = ctx->error_depth;

crypto/x509/x509_vfy.c:1169:5: 
1167.   {
1168.       X509 *crl_issuer = NULL;
1169. >     X509_NAME *cnm = X509_CRL_get_issuer(crl);
1170.       int cidx = ctx->error_depth;
1171.       int i;

crypto/x509/x509cset.c:113:1: start of procedure X509_CRL_get_issuer()
  111.   }
  112.   
  113. > X509_NAME *X509_CRL_get_issuer(X509_CRL *crl)
  114.   {
  115.       return crl->crl.issuer;

crypto/x509/x509cset.c:115:5: 
  113.   X509_NAME *X509_CRL_get_issuer(X509_CRL *crl)
  114.   {
  115. >     return crl->crl.issuer;
  116.   }
  117.   

crypto/x509/x509cset.c:116:1: return from a call to X509_CRL_get_issuer
  114.   {
  115.       return crl->crl.issuer;
  116. > }
  117.   
  118.   STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(X509_CRL *crl)

crypto/x509/x509_vfy.c:1170:5: 
1168.       X509 *crl_issuer = NULL;
1169.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1170. >     int cidx = ctx->error_depth;
1171.       int i;
1172.   

crypto/x509/x509_vfy.c:1173:9: 
1171.       int i;
1172.   
1173. >     if (cidx != sk_X509_num(ctx->chain) - 1)
1174.           cidx++;
1175.   

include/openssl/x509.h:98:1: start of procedure sk_X509_num()
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_num()
    263.   }
    264.   
    265. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)

crypto/stack/stack.c:267:9: Taking true branch
    265.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)
                   ^
    268.           return -1;
    269.       return st->num;

crypto/stack/stack.c:268:9: 
    266.   {
    267.       if (st == NULL)
    268. >         return -1;
    269.       return st->num;
    270.   }

crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_num
    268.           return -1;
    269.       return st->num;
    270. > }
    271.   
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

include/openssl/x509.h:98:1: return from a call to sk_X509_num
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1173:9: Taking true branch
1171.       int i;
1172.   
1173.       if (cidx != sk_X509_num(ctx->chain) - 1)
                ^
1174.           cidx++;
1175.   

crypto/x509/x509_vfy.c:1174:9: 
1172.   
1173.       if (cidx != sk_X509_num(ctx->chain) - 1)
1174. >         cidx++;
1175.   
1176.       crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:1176:5: 
1174.           cidx++;
1175.   
1176. >     crl_issuer = sk_X509_value(ctx->chain, cidx);
1177.   
1178.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

include/openssl/x509.h:98:1: start of procedure sk_X509_value()
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:272:1: start of procedure OPENSSL_sk_value()
    270.   }
    271.   
    272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:274:9: Taking true branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:275:9: 
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
    275. >         return NULL;
    276.       return st->data[i];
    277.   }

crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value
    275.           return NULL;
    276.       return st->data[i];
    277. > }
    278.   
    279.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value)

include/openssl/x509.h:98:1: return from a call to sk_X509_value
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1178:9: 
1176.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1177.   
1178. >     if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1179.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1180.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509v3/v3_purp.c:768:1: start of procedure X509_check_akid()
  766.   }
  767.   
  768. > int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid)
  769.   {
  770.   

crypto/x509v3/v3_purp.c:771:10: Taking false branch
  769.   {
  770.   
  771.       if (!akid)
                  ^
  772.           return X509_V_OK;
  773.   

crypto/x509v3/v3_purp.c:775:9: Taking false branch
  773.   
  774.       /* Check key ids (if present) */
  775.       if (akid->keyid && issuer->skid &&
                 ^
  776.           ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid))
  777.           return X509_V_ERR_AKID_SKID_MISMATCH;

crypto/x509v3/v3_purp.c:779:9: Taking false branch
  777.           return X509_V_ERR_AKID_SKID_MISMATCH;
  778.       /* Check serial number */
  779.       if (akid->serial &&
                 ^
  780.           ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial))
  781.           return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;

crypto/x509v3/v3_purp.c:783:9: Taking false branch
  781.           return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  782.       /* Check issuer name */
  783.       if (akid->issuer) {
                 ^
  784.           /*
  785.            * Ugh, for some peculiar reason AKID includes SEQUENCE OF

crypto/x509v3/v3_purp.c:804:5: 
  802.               return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  803.       }
  804. >     return X509_V_OK;
  805.   }
  806.   

crypto/x509v3/v3_purp.c:805:1: return from a call to X509_check_akid
  803.       }
  804.       return X509_V_OK;
  805. > }
  806.   
  807.   uint32_t X509_get_extension_flags(X509 *x)

crypto/x509/x509_vfy.c:1178:9: Taking true branch
1176.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1177.   
1178.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
                ^
1179.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1180.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509/x509_vfy.c:1179:13: Taking false branch
1177.   
1178.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1179.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
                    ^
1180.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;
1181.               *pissuer = crl_issuer;

crypto/x509/x509_vfy.c:1186:10: 
1184.       }
1185.   
1186. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1187.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1188.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1186:18: 
1184.       }
1185.   
1186. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1187.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1188.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

include/openssl/x509.h:98:1: start of procedure sk_X509_num()
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_num()
    263.   }
    264.   
    265. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)

crypto/stack/stack.c:267:9: Taking true branch
    265.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)
                   ^
    268.           return -1;
    269.       return st->num;

crypto/stack/stack.c:268:9: 
    266.   {
    267.       if (st == NULL)
    268. >         return -1;
    269.       return st->num;
    270.   }

crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_num
    268.           return -1;
    269.       return st->num;
    270. > }
    271.   
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

include/openssl/x509.h:98:1: return from a call to sk_X509_num
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1186:18: Loop condition is true. Entering loop body
1184.       }
1185.   
1186.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
                         ^
1187.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1188.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1187:9: 
1185.   
1186.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1187. >         crl_issuer = sk_X509_value(ctx->chain, cidx);
1188.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1189.               continue;

include/openssl/x509.h:98:1: start of procedure sk_X509_value()
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:272:1: start of procedure OPENSSL_sk_value()
    270.   }
    271.   
    272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:274:9: Taking true branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:275:9: 
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
    275. >         return NULL;
    276.       return st->data[i];
    277.   }

crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value
    275.           return NULL;
    276.       return st->data[i];
    277. > }
    278.   
    279.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value)

include/openssl/x509.h:98:1: return from a call to sk_X509_value
  96.   typedef struct x509_cinf_st X509_CINF;
  97.   
  98. > DEFINE_STACK_OF(X509)
  99.   
  100.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1188:13: 
1186.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1187.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1188. >         if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1189.               continue;
1190.           if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

crypto/x509/x509_cmp.c:100:1: start of procedure X509_get_subject_name()
  98.   #endif
  99.   
  100. > X509_NAME *X509_get_subject_name(X509 *a)
  101.   {
  102.       return (a->cert_info.subject);

crypto/x509/x509_cmp.c:102:5: 
  100.   X509_NAME *X509_get_subject_name(X509 *a)
  101.   {
  102. >     return (a->cert_info.subject);
  103.   }
  104.   
