crypto/x509/x509_vfy.c:154: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 140 could be null and is dereferenced by call to `X509_get_issuer_name()` at line 154, column 6.
Showing all 27 steps of the trace


crypto/x509/x509_vfy.c:99:1: start of procedure X509_verify_cert()
97.   #endif
98.   
99. > int X509_verify_cert(X509_STORE_CTX *ctx)
100.   	{
101.   	X509 *x,*xtmp,*chain_ss=NULL;

crypto/x509/x509_vfy.c:101:2: 
99.   int X509_verify_cert(X509_STORE_CTX *ctx)
100.   	{
101. > 	X509 *x,*xtmp,*chain_ss=NULL;
102.   	X509_NAME *xn;
103.   	int bad_chain = 0;

crypto/x509/x509_vfy.c:103:2: 
101.   	X509 *x,*xtmp,*chain_ss=NULL;
102.   	X509_NAME *xn;
103. > 	int bad_chain = 0;
104.   	X509_VERIFY_PARAM *param = ctx->param;
105.   	int depth,i,ok=0;

crypto/x509/x509_vfy.c:104:2: 
102.   	X509_NAME *xn;
103.   	int bad_chain = 0;
104. > 	X509_VERIFY_PARAM *param = ctx->param;
105.   	int depth,i,ok=0;
106.   	int num;

crypto/x509/x509_vfy.c:105:2: 
103.   	int bad_chain = 0;
104.   	X509_VERIFY_PARAM *param = ctx->param;
105. > 	int depth,i,ok=0;
106.   	int num;
107.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:108:2: 
106.   	int num;
107.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
108. > 	STACK_OF(X509) *sktmp=NULL;
109.   	if (ctx->cert == NULL)
110.   		{

crypto/x509/x509_vfy.c:109:6: Taking false branch
107.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
108.   	STACK_OF(X509) *sktmp=NULL;
109.   	if (ctx->cert == NULL)
            ^
110.   		{
111.   		X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);

crypto/x509/x509_vfy.c:115:2: 
113.   		}
114.   
115. > 	cb=ctx->verify_cb;
116.   
117.   	/* first we make sure the chain we are going to build is

crypto/x509/x509_vfy.c:119:6: Taking false branch
117.   	/* first we make sure the chain we are going to build is
118.   	 * present and that the first entry is in place */
119.   	if (ctx->chain == NULL)
            ^
120.   		{
121.   		if (	((ctx->chain=sk_X509_new_null()) == NULL) ||

crypto/x509/x509_vfy.c:132:6: Taking false branch
130.   
131.   	/* We use a temporary STACK so we can chop and hack at it */
132.   	if (ctx->untrusted != NULL
            ^
133.   	    && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL)
134.   		{

crypto/x509/x509_vfy.c:139:2: 
137.   		}
138.   
139. > 	num=sk_X509_num(ctx->chain);
140.   	x=sk_X509_value(ctx->chain,num-1);
141.   	depth=param->depth;

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

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

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

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

crypto/x509/x509_vfy.c:140:2: 
138.   
139.   	num=sk_X509_num(ctx->chain);
140. > 	x=sk_X509_value(ctx->chain,num-1);
141.   	depth=param->depth;
142.   

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

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

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

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

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

crypto/x509/x509_vfy.c:141:2: 
139.   	num=sk_X509_num(ctx->chain);
140.   	x=sk_X509_value(ctx->chain,num-1);
141. > 	depth=param->depth;
142.   
143.   

crypto/x509/x509_vfy.c:179:3: Loop condition is true. Entering loop body
177.   			}
178.   		break;
179.   		}
         ^
180.   
181.   	/* at this point, chain should contain a list of untrusted

crypto/x509/x509_vfy.c:147:7: Taking false branch
145.   		{
146.   		/* If we have enough, we break */
147.   		if (depth < num) break; /* FIXME: If this happens, we should take
             ^
148.   		                         * note of it and, if appropriate, use the
149.   		                         * X509_V_ERR_CERT_CHAIN_TOO_LONG error

crypto/x509/x509_vfy.c:154:3: 
152.   
153.   		/* If we are self signed, we break */
154. > 		xn=X509_get_issuer_name(x);
155.   		if (ctx->check_issued(ctx, x,x)) break;
156.   

crypto/x509/x509_cmp.c:126:1: start of procedure X509_get_issuer_name()
  124.   #endif
  125.   
  126. > X509_NAME *X509_get_issuer_name(X509 *a)
  127.   	{
  128.   	return(a->cert_info->issuer);

crypto/x509/x509_cmp.c:128:2: 
  126.   X509_NAME *X509_get_issuer_name(X509 *a)
  127.   	{
  128. > 	return(a->cert_info->issuer);
  129.   	}
  130.   
