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


crypto/x509/x509_vfy.c:1181:1: start of procedure crl_akid_check()
1179.   }
1180.   
1181. > static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,
1182.                              X509 **pissuer, int *pcrl_score)
1183.   {

crypto/x509/x509_vfy.c:1184:5: 
1182.                              X509 **pissuer, int *pcrl_score)
1183.   {
1184. >     X509 *crl_issuer = NULL;
1185.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1186.       int cidx = ctx->error_depth;

crypto/x509/x509_vfy.c:1185:5: 
1183.   {
1184.       X509 *crl_issuer = NULL;
1185. >     X509_NAME *cnm = X509_CRL_get_issuer(crl);
1186.       int cidx = ctx->error_depth;
1187.       int i;

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

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

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

crypto/x509/x509_vfy.c:1186:5: 
1184.       X509 *crl_issuer = NULL;
1185.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1186. >     int cidx = ctx->error_depth;
1187.       int i;
1188.   

crypto/x509/x509_vfy.c:1189:9: 
1187.       int i;
1188.   
1189. >     if (cidx != sk_X509_num(ctx->chain) - 1)
1190.           cidx++;
1191.   

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

crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_num()
    275.   }
    276.   
    277. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    278.   {
    279.       if (st == NULL)

crypto/stack/stack.c:279:9: Taking true branch
    277.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    278.   {
    279.       if (st == NULL)
                   ^
    280.           return -1;
    281.       return st->num;

crypto/stack/stack.c:280:9: 
    278.   {
    279.       if (st == NULL)
    280. >         return -1;
    281.       return st->num;
    282.   }

crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_num
    280.           return -1;
    281.       return st->num;
    282. > }
    283.   
    284.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

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

crypto/x509/x509_vfy.c:1189:9: Taking true branch
1187.       int i;
1188.   
1189.       if (cidx != sk_X509_num(ctx->chain) - 1)
                ^
1190.           cidx++;
1191.   

crypto/x509/x509_vfy.c:1190:9: 
1188.   
1189.       if (cidx != sk_X509_num(ctx->chain) - 1)
1190. >         cidx++;
1191.   
1192.       crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:1192:5: 
1190.           cidx++;
1191.   
1192. >     crl_issuer = sk_X509_value(ctx->chain, cidx);
1193.   
1194.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

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

crypto/stack/stack.c:284:1: start of procedure OPENSSL_sk_value()
    282.   }
    283.   
    284. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:286:9: Taking true branch
    284.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    287.           return NULL;
    288.       return (void *)st->data[i];

crypto/stack/stack.c:287:9: 
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
    287. >         return NULL;
    288.       return (void *)st->data[i];
    289.   }

crypto/stack/stack.c:289:1: return from a call to OPENSSL_sk_value
    287.           return NULL;
    288.       return (void *)st->data[i];
    289. > }
    290.   
    291.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)

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

crypto/x509/x509_vfy.c:1194:9: 
1192.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1193.   
1194. >     if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1195.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1196.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:1194:9: Taking true branch
1192.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1193.   
1194.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
                ^
1195.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1196.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509/x509_vfy.c:1195:13: Taking false branch
1193.   
1194.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1195.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
                    ^
1196.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;
1197.               *pissuer = crl_issuer;

crypto/x509/x509_vfy.c:1202:10: 
1200.       }
1201.   
1202. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1203.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1204.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1202:18: 
1200.       }
1201.   
1202. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1203.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1204.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

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

crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_num()
    275.   }
    276.   
    277. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    278.   {
    279.       if (st == NULL)

crypto/stack/stack.c:279:9: Taking true branch
    277.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    278.   {
    279.       if (st == NULL)
                   ^
    280.           return -1;
    281.       return st->num;

crypto/stack/stack.c:280:9: 
    278.   {
    279.       if (st == NULL)
    280. >         return -1;
    281.       return st->num;
    282.   }

crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_num
    280.           return -1;
    281.       return st->num;
    282. > }
    283.   
    284.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

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

crypto/x509/x509_vfy.c:1202:18: Loop condition is true. Entering loop body
1200.       }
1201.   
1202.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
                         ^
1203.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1204.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1203:9: 
1201.   
1202.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1203. >         crl_issuer = sk_X509_value(ctx->chain, cidx);
1204.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1205.               continue;

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

crypto/stack/stack.c:284:1: start of procedure OPENSSL_sk_value()
    282.   }
    283.   
    284. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:286:9: Taking true branch
    284.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    287.           return NULL;
    288.       return (void *)st->data[i];

crypto/stack/stack.c:287:9: 
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
    287. >         return NULL;
    288.       return (void *)st->data[i];
    289.   }

crypto/stack/stack.c:289:1: return from a call to OPENSSL_sk_value
    287.           return NULL;
    288.       return (void *)st->data[i];
    289. > }
    290.   
    291.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)

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

crypto/x509/x509_vfy.c:1204:13: 
1202.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1203.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1204. >         if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1205.               continue;
1206.           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(const X509 *a)
  101.   {
  102.       return (a->cert_info.subject);

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