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


crypto/x509/x509_vfy.c:1032:1: start of procedure crl_akid_check()
1030.   }
1031.   
1032. > static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl,
1033.                              X509 **pissuer, int *pcrl_score)
1034.   {

crypto/x509/x509_vfy.c:1035:5: 
1033.                              X509 **pissuer, int *pcrl_score)
1034.   {
1035. >     X509 *crl_issuer = NULL;
1036.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1037.       int cidx = ctx->error_depth;

crypto/x509/x509_vfy.c:1036:5: 
1034.   {
1035.       X509 *crl_issuer = NULL;
1036. >     X509_NAME *cnm = X509_CRL_get_issuer(crl);
1037.       int cidx = ctx->error_depth;
1038.       int i;

crypto/x509/x509cset.c:156:1: start of procedure X509_CRL_get_issuer()
  154.   }
  155.   
  156. > X509_NAME *X509_CRL_get_issuer(X509_CRL *crl)
  157.   {
  158.       return crl->crl.issuer;

crypto/x509/x509cset.c:158:5: 
  156.   X509_NAME *X509_CRL_get_issuer(X509_CRL *crl)
  157.   {
  158. >     return crl->crl.issuer;
  159.   }
  160.   

crypto/x509/x509cset.c:159:1: return from a call to X509_CRL_get_issuer
  157.   {
  158.       return crl->crl.issuer;
  159. > }
  160.   
  161.   STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(X509_CRL *crl)

crypto/x509/x509_vfy.c:1037:5: 
1035.       X509 *crl_issuer = NULL;
1036.       X509_NAME *cnm = X509_CRL_get_issuer(crl);
1037. >     int cidx = ctx->error_depth;
1038.       int i;
1039.   

crypto/x509/x509_vfy.c:1040:9: 
1038.       int i;
1039.   
1040. >     if (cidx != sk_X509_num(ctx->chain) - 1)
1041.           cidx++;
1042.   

include/openssl/x509.h:170:1: start of procedure sk_X509_num()
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking true branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:320:9: 
    318.   {
    319.       if (st == NULL)
    320. >         return -1;
    321.       return st->num;
    322.   }

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

include/openssl/x509.h:170:1: return from a call to sk_X509_num
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1040:9: Taking true branch
1038.       int i;
1039.   
1040.       if (cidx != sk_X509_num(ctx->chain) - 1)
                ^
1041.           cidx++;
1042.   

crypto/x509/x509_vfy.c:1041:9: 
1039.   
1040.       if (cidx != sk_X509_num(ctx->chain) - 1)
1041. >         cidx++;
1042.   
1043.       crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:1043:5: 
1041.           cidx++;
1042.   
1043. >     crl_issuer = sk_X509_value(ctx->chain, cidx);
1044.   
1045.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

include/openssl/x509.h:170:1: start of procedure sk_X509_value()
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

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

include/openssl/x509.h:170:1: return from a call to sk_X509_value
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1045:9: 
1043.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1044.   
1045. >     if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1046.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1047.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509v3/v3_purp.c:813:1: start of procedure X509_check_akid()
  811.   }
  812.   
  813. > int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid)
  814.   {
  815.   

crypto/x509v3/v3_purp.c:816:10: Taking false branch
  814.   {
  815.   
  816.       if (!akid)
                  ^
  817.           return X509_V_OK;
  818.   

crypto/x509v3/v3_purp.c:820:9: Taking false branch
  818.   
  819.       /* Check key ids (if present) */
  820.       if (akid->keyid && issuer->skid &&
                 ^
  821.           ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid))
  822.           return X509_V_ERR_AKID_SKID_MISMATCH;

crypto/x509v3/v3_purp.c:824:9: Taking false branch
  822.           return X509_V_ERR_AKID_SKID_MISMATCH;
  823.       /* Check serial number */
  824.       if (akid->serial &&
                 ^
  825.           ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial))
  826.           return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;

crypto/x509v3/v3_purp.c:828:9: Taking false branch
  826.           return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  827.       /* Check issuer name */
  828.       if (akid->issuer) {
                 ^
  829.           /*
  830.            * Ugh, for some peculiar reason AKID includes SEQUENCE OF

crypto/x509v3/v3_purp.c:849:5: 
  847.               return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  848.       }
  849. >     return X509_V_OK;
  850.   }
  851.   

crypto/x509v3/v3_purp.c:850:1: return from a call to X509_check_akid
  848.       }
  849.       return X509_V_OK;
  850. > }
  851.   
  852.   uint32_t X509_get_extension_flags(X509 *x)

crypto/x509/x509_vfy.c:1045:9: Taking true branch
1043.       crl_issuer = sk_X509_value(ctx->chain, cidx);
1044.   
1045.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
                ^
1046.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
1047.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;

crypto/x509/x509_vfy.c:1046:13: Taking false branch
1044.   
1045.       if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {
1046.           if (*pcrl_score & CRL_SCORE_ISSUER_NAME) {
                    ^
1047.               *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT;
1048.               *pissuer = crl_issuer;

crypto/x509/x509_vfy.c:1053:10: 
1051.       }
1052.   
1053. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1054.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1055.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1053:18: 
1051.       }
1052.   
1053. >     for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1054.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1055.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

include/openssl/x509.h:170:1: start of procedure sk_X509_num()
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking true branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:320:9: 
    318.   {
    319.       if (st == NULL)
    320. >         return -1;
    321.       return st->num;
    322.   }

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

include/openssl/x509.h:170:1: return from a call to sk_X509_num
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1053:18: Loop condition is true. Entering loop body
1051.       }
1052.   
1053.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
                         ^
1054.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1055.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))

crypto/x509/x509_vfy.c:1054:9: 
1052.   
1053.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1054. >         crl_issuer = sk_X509_value(ctx->chain, cidx);
1055.           if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1056.               continue;

include/openssl/x509.h:170:1: start of procedure sk_X509_value()
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

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

include/openssl/x509.h:170:1: return from a call to sk_X509_value
  168.   typedef struct x509_cinf_st X509_CINF;
  169.   
  170. > DEFINE_STACK_OF(X509)
  171.   
  172.   /* This is used for a table of trust checking functions */

crypto/x509/x509_vfy.c:1055:13: 
1053.       for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) {
1054.           crl_issuer = sk_X509_value(ctx->chain, cidx);
1055. >         if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
1056.               continue;
1057.           if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) {

crypto/x509/x509_cmp.c:149:1: start of procedure X509_get_subject_name()
  147.   #endif
  148.   
  149. > X509_NAME *X509_get_subject_name(X509 *a)
  150.   {
  151.       return (a->cert_info.subject);

crypto/x509/x509_cmp.c:151:5: 
  149.   X509_NAME *X509_get_subject_name(X509 *a)
  150.   {
  151. >     return (a->cert_info.subject);
  152.   }
  153.   
