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


crypto/x509/x509_vfy.c:821:1: start of procedure crl_akid_check()
819.   	}
820.   
821. > static int crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer)
822.   	{
823.   	X509 *crl_issuer;

crypto/x509/x509_vfy.c:824:2: 
822.   	{
823.   	X509 *crl_issuer;
824. > 	X509_NAME *cnm = X509_CRL_get_issuer(crl);
825.   	int cidx = ctx->error_depth;
826.   	int i;

crypto/x509/x509_vfy.c:825:2: 
823.   	X509 *crl_issuer;
824.   	X509_NAME *cnm = X509_CRL_get_issuer(crl);
825. > 	int cidx = ctx->error_depth;
826.   	int i;
827.   	if (!crl->akid)

crypto/x509/x509_vfy.c:827:7: Taking false branch
825.   	int cidx = ctx->error_depth;
826.   	int i;
827.   	if (!crl->akid)
             ^
828.   		return 1;
829.   	if (cidx != sk_X509_num(ctx->chain) - 1)

crypto/x509/x509_vfy.c:829:14: Condition is true
827.   	if (!crl->akid)
828.   		return 1;
829.   	if (cidx != sk_X509_num(ctx->chain) - 1)
                    ^
830.   		cidx++;
831.   	crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:829:6: 
827.   	if (!crl->akid)
828.   		return 1;
829. > 	if (cidx != sk_X509_num(ctx->chain) - 1)
830.   		cidx++;
831.   	crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/stack/stack.c:302:1: start of procedure sk_num()
  300.   	}
  301.   
  302. > int sk_num(const _STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;

crypto/stack/stack.c:304:5: Taking false branch
  302.   int sk_num(const _STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;
             ^
  305.   	return st->num;
  306.   }

crypto/stack/stack.c:305:2: 
  303.   {
  304.   	if(st == NULL) return -1;
  305. > 	return st->num;
  306.   }
  307.   

crypto/stack/stack.c:306:1: return from a call to sk_num
  304.   	if(st == NULL) return -1;
  305.   	return st->num;
  306. > }
  307.   
  308.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:829:6: Taking true branch
827.   	if (!crl->akid)
828.   		return 1;
829.   	if (cidx != sk_X509_num(ctx->chain) - 1)
            ^
830.   		cidx++;
831.   	crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:830:3: 
828.   		return 1;
829.   	if (cidx != sk_X509_num(ctx->chain) - 1)
830. > 		cidx++;
831.   	crl_issuer = sk_X509_value(ctx->chain, cidx);
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)

crypto/x509/x509_vfy.c:831:15: Condition is true
829.   	if (cidx != sk_X509_num(ctx->chain) - 1)
830.   		cidx++;
831.   	crl_issuer = sk_X509_value(ctx->chain, cidx);
                     ^
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
833.   		return 1;

crypto/x509/x509_vfy.c:831:2: 
829.   	if (cidx != sk_X509_num(ctx->chain) - 1)
830.   		cidx++;
831. > 	crl_issuer = sk_X509_value(ctx->chain, cidx);
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
833.   		return 1;

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:13: Taking true branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:39: 
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:312:1: return from a call to sk_value
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312. > }
  313.   
  314.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:832:6: Taking false branch
830.   		cidx++;
831.   	crl_issuer = sk_X509_value(ctx->chain, cidx);
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
            ^
833.   		return 1;
834.   	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)

crypto/x509/x509_vfy.c:834:7: 
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
833.   		return 1;
834. > 	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
835.   		{
836.   		crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:834:22: Condition is true
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
833.   		return 1;
834.   	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
                            ^
835.   		{
836.   		crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:834:15: 
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
833.   		return 1;
834. > 	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
835.   		{
836.   		crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/stack/stack.c:302:1: start of procedure sk_num()
  300.   	}
  301.   
  302. > int sk_num(const _STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;

crypto/stack/stack.c:304:5: Taking false branch
  302.   int sk_num(const _STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;
             ^
  305.   	return st->num;
  306.   }

crypto/stack/stack.c:305:2: 
  303.   {
  304.   	if(st == NULL) return -1;
  305. > 	return st->num;
  306.   }
  307.   

crypto/stack/stack.c:306:1: return from a call to sk_num
  304.   	if(st == NULL) return -1;
  305.   	return st->num;
  306. > }
  307.   
  308.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:834:15: Loop condition is true. Entering loop body
832.   	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
833.   		return 1;
834.   	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
                     ^
835.   		{
836.   		crl_issuer = sk_X509_value(ctx->chain, cidx);

crypto/x509/x509_vfy.c:836:16: Condition is true
834.   	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
835.   		{
836.   		crl_issuer = sk_X509_value(ctx->chain, cidx);
                      ^
837.   		if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
838.   			continue;

crypto/x509/x509_vfy.c:836:3: 
834.   	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
835.   		{
836. > 		crl_issuer = sk_X509_value(ctx->chain, cidx);
837.   		if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
838.   			continue;

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:13: Taking true branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:39: 
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:312:1: return from a call to sk_value
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312. > }
  313.   
  314.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:837:7: 
835.   		{
836.   		crl_issuer = sk_X509_value(ctx->chain, cidx);
837. > 		if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
838.   			continue;
839.   		if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)

crypto/x509/x509_cmp.c:136:1: start of procedure X509_get_subject_name()
  134.   	}
  135.   
  136. > X509_NAME *X509_get_subject_name(X509 *a)
  137.   	{
  138.   	return(a->cert_info->subject);

crypto/x509/x509_cmp.c:138:2: 
  136.   X509_NAME *X509_get_subject_name(X509 *a)
  137.   	{
  138. > 	return(a->cert_info->subject);
  139.   	}
  140.   

static int crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer)
	{
	X509 *crl_issuer;
	X509_NAME *cnm = X509_CRL_get_issuer(crl);
	int cidx = ctx->error_depth;
	int i;
	if (!crl->akid)
		return 1;
	if (cidx != sk_X509_num(ctx->chain) - 1)
		cidx++;
	crl_issuer = sk_X509_value(ctx->chain, cidx);
	if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
		return 1;
	for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)
		{
		crl_issuer = sk_X509_value(ctx->chain, cidx);
		if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))
			continue;
		if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
			{
			*pissuer = crl_issuer;
			return 1;
			}
		}
	if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT))
		return 0;
	for (i = 0; i < sk_X509_num(ctx->untrusted); i++)
		{
		crl_issuer = sk_X509_value(ctx->untrusted, i);
		if (X509_NAME_cmp(X509_get_subject_name(crl_issuer),
					X509_CRL_get_issuer(crl)))
			continue;
		if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)
			{
			if (check_crl_path(ctx, crl_issuer))
				{
				*pissuer = crl_issuer;
				return 1;
				}
			}
		}
	return 0;
	}
['static int crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer)\n\t{\n\tX509 *crl_issuer;\n\tX509_NAME *cnm = X509_CRL_get_issuer(crl);\n\tint cidx = ctx->error_depth;\n\tint i;\n\tif (!crl->akid)\n\t\treturn 1;\n\tif (cidx != sk_X509_num(ctx->chain) - 1)\n\t\tcidx++;\n\tcrl_issuer = sk_X509_value(ctx->chain, cidx);\n\tif (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)\n\t\treturn 1;\n\tfor (cidx++; cidx < sk_X509_num(ctx->chain); cidx++)\n\t\t{\n\t\tcrl_issuer = sk_X509_value(ctx->chain, cidx);\n\t\tif (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm))\n\t\t\tcontinue;\n\t\tif (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)\n\t\t\t{\n\t\t\t*pissuer = crl_issuer;\n\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\tif (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT))\n\t\treturn 0;\n\tfor (i = 0; i < sk_X509_num(ctx->untrusted); i++)\n\t\t{\n\t\tcrl_issuer = sk_X509_value(ctx->untrusted, i);\n\t\tif (X509_NAME_cmp(X509_get_subject_name(crl_issuer),\n\t\t\t\t\tX509_CRL_get_issuer(crl)))\n\t\t\tcontinue;\n\t\tif (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK)\n\t\t\t{\n\t\t\tif (check_crl_path(ctx, crl_issuer))\n\t\t\t\t{\n\t\t\t\t*pissuer = crl_issuer;\n\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treturn 0;\n\t}', 'int sk_num(const _STACK *st)\n{\n\tif(st == NULL) return -1;\n\treturn st->num;\n}', 'void *sk_value(const _STACK *st, int i)\n{\n\tif(!st || (i < 0) || (i >= st->num)) return NULL;\n\treturn st->data[i];\n}', 'X509_NAME *X509_get_subject_name(X509 *a)\n\t{\n\treturn(a->cert_info->subject);\n\t}']