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


crypto/x509/x509_vfy.c:1186:1: start of procedure crl_akid_check()
1184.   }
1185.   
1186. > static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,
1187.                              X509 **pissuer, int *pcrl_score)
1188.   {

crypto/x509/x509_vfy.c:1189:5: 
1187.                              X509 **pissuer, int *pcrl_score)
1188.   {
1189. >     X509 *crl_issuer = NULL;
1190.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1191.       int cidx = ctx->error_depth;

crypto/x509/x509_vfy.c:1190:5: 
1188.   {
1189.       X509 *crl_issuer = NULL;
1190. >     X509_NAME *cnm = X509_CRL_get_issuer(crl);
1191.       int cidx = ctx->error_depth;
1192.       int i;

crypto/x509/x509cset.c:106:1: start of procedure X509_CRL_get_issuer()
  104.   #endif
  105.   
  106. > X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl)
  107.   {
  108.       return crl->crl.issuer;

crypto/x509/x509cset.c:108:5: 
  106.   X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl)
  107.   {
  108. >     return crl->crl.issuer;
  109.   }
  110.   

crypto/x509/x509cset.c:109:1: return from a call to X509_CRL_get_issuer
  107.   {
  108.       return crl->crl.issuer;
  109. > }
  110.   
  111.   const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl)

crypto/x509/x509_vfy.c:1191:5: 
1189.       X509 *crl_issuer = NULL;
1190.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1191. >     int cidx = ctx->error_depth;
1192.       int i;
1193.   

crypto/x509/x509_vfy.c:1194:9: 
1192.       int i;
1193.   
1194. >     if (cidx != sk_X509_num(ctx->chain) - 1)
1195.           cidx++;
1196.   

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

crypto/stack/stack.c:376:1: start of procedure OPENSSL_sk_num()
    374.   }
    375.   
    376. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    377.   {
    378.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:378:12: Condition is true
    376.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    377.   {
    378.       return st == NULL ? -1 : st->num;
                      ^
    379.   }
    380.   

crypto/stack/stack.c:378:5: 
    376.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    377.   {
    378. >     return st == NULL ? -1 : st->num;
    379.   }
    380.   

crypto/stack/stack.c:379:1: return from a call to OPENSSL_sk_num
    377.   {
    378.       return st == NULL ? -1 : st->num;
    379. > }
    380.   
    381.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

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

crypto/x509/x509_vfy.c:1194:9: Taking true branch
1192.       int i;
1193.   
1194.       if (cidx != sk_X509_num(ctx->chain) - 1)
                ^
1195.           cidx++;
1196.   

crypto/x509/x509_vfy.c:1195:9: 
1193.   
1194.       if (cidx != sk_X509_num(ctx->chain) - 1)
1195. >         cidx++;
1196.   
1197.       crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:1197:5: 
1195.           cidx++;
1196.   
1197. >     crl_issuer = sk_X509_value(ctx->chain, cidx);
1198.   
1199.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

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

crypto/stack/stack.c:381:1: start of procedure OPENSSL_sk_value()
    379.   }
    380.   
    381. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    382.   {
    383.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:383:9: Taking true branch
    381.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    382.   {
    383.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    384.           return NULL;
    385.       return (void *)st->data[i];

crypto/stack/stack.c:384:9: 
    382.   {
    383.       if (st == NULL || i < 0 || i >= st->num)
    384. >         return NULL;
    385.       return (void *)st->data[i];
    386.   }

crypto/stack/stack.c:386:1: return from a call to OPENSSL_sk_value
    384.           return NULL;
    385.       return (void *)st->data[i];
    386. > }
    387.   
    388.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)

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

crypto/x509/x509_vfy.c:1199:9: 
1197.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1198.   
1199. >     if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1200.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1201.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509v3/v3_purp.c:780:1: start of procedure X509_check_akid()
  778.   }
  779.   
  780. > int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid)
  781.   {
  782.   

crypto/x509v3/v3_purp.c:783:10: Taking false branch
  781.   {
  782.   
  783.       if (!akid)
                  ^
  784.           return X509_V_OK;
  785.   

crypto/x509v3/v3_purp.c:787:9: Taking false branch
  785.   
  786.       /* Check key ids (if present) */
  787.       if (akid->keyid && issuer->skid &&
                 ^
  788.           ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid))
  789.           return X509_V_ERR_AKID_SKID_MISMATCH;

crypto/x509v3/v3_purp.c:791:9: Taking false branch
  789.           return X509_V_ERR_AKID_SKID_MISMATCH;
  790.       /* Check serial number */
  791.       if (akid->serial &&
                 ^
  792.           ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial))
  793.           return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;

crypto/x509v3/v3_purp.c:795:9: Taking false branch
  793.           return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  794.       /* Check issuer name */
  795.       if (akid->issuer) {
                 ^
  796.           /*
  797.            * Ugh, for some peculiar reason AKID includes SEQUENCE OF

crypto/x509v3/v3_purp.c:816:5: 
  814.               return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  815.       }
  816. >     return X509_V_OK;
  817.   }
  818.   

crypto/x509v3/v3_purp.c:817:1: return from a call to X509_check_akid
  815.       }
  816.       return X509_V_OK;
  817. > }
  818.   
  819.   uint32_t X509_get_extension_flags(X509 *x)

crypto/x509/x509_vfy.c:1199:9: Taking true branch
1197.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1198.   
1199.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
                ^
1200.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1201.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509/x509_vfy.c:1200:13: Taking false branch
1198.   
1199.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1200.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
                    ^
1201.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;
1202.               *pissuer = crl_issuer;

crypto/x509/x509_vfy.c:1207:10: 
1205.       }
1206.   
1207. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1208.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1209.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1207:18: 
1205.       }
1206.   
1207. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1208.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1209.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

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

crypto/stack/stack.c:376:1: start of procedure OPENSSL_sk_num()
    374.   }
    375.   
    376. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    377.   {
    378.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:378:12: Condition is true
    376.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    377.   {
    378.       return st == NULL ? -1 : st->num;
                      ^
    379.   }
    380.   

crypto/stack/stack.c:378:5: 
    376.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    377.   {
    378. >     return st == NULL ? -1 : st->num;
    379.   }
    380.   

crypto/stack/stack.c:379:1: return from a call to OPENSSL_sk_num
    377.   {
    378.       return st == NULL ? -1 : st->num;
    379. > }
    380.   
    381.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

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

crypto/x509/x509_vfy.c:1207:18: Loop condition is true. Entering loop body
1205.       }
1206.   
1207.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
                         ^
1208.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1209.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1208:9: 
1206.   
1207.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1208. >         crl_issuer = sk_X509_value(ctx->chain, cidx);
1209.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1210.               continue;

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

crypto/stack/stack.c:381:1: start of procedure OPENSSL_sk_value()
    379.   }
    380.   
    381. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    382.   {
    383.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:383:9: Taking true branch
    381.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    382.   {
    383.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    384.           return NULL;
    385.       return (void *)st->data[i];

crypto/stack/stack.c:384:9: 
    382.   {
    383.       if (st == NULL || i < 0 || i >= st->num)
    384. >         return NULL;
    385.       return (void *)st->data[i];
    386.   }

crypto/stack/stack.c:386:1: return from a call to OPENSSL_sk_value
    384.           return NULL;
    385.       return (void *)st->data[i];
    386. > }
    387.   
    388.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)

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

crypto/x509/x509_vfy.c:1209:13: 
1207.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1208.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1209. >         if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1210.               continue;
1211.           if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

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

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