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


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

crypto/x509/x509_vfy.c:98:2: 
96.   int X509_verify_cert(X509_STORE_CTX *ctx)
97.   	{
98. > 	X509 *x,*xtmp,*chain_ss=NULL;
99.   	X509_NAME *xn;
100.   	int depth,i,ok=0;

crypto/x509/x509_vfy.c:100:2: 
98.   	X509 *x,*xtmp,*chain_ss=NULL;
99.   	X509_NAME *xn;
100. > 	int depth,i,ok=0;
101.   	int num;
102.   	int (*cb)();

crypto/x509/x509_vfy.c:103:2: 
101.   	int num;
102.   	int (*cb)();
103. > 	STACK_OF(X509) *sktmp=NULL;
104.   
105.   	if (ctx->cert == NULL)

crypto/x509/x509_vfy.c:105:6: Taking false branch
103.   	STACK_OF(X509) *sktmp=NULL;
104.   
105.   	if (ctx->cert == NULL)
            ^
106.   		{
107.   		X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);

crypto/x509/x509_vfy.c:111:2: 
109.   		}
110.   
111. > 	cb=ctx->verify_cb;
112.   
113.   	/* first we make sure the chain we are going to build is

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

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

crypto/x509/x509_vfy.c:135:2: 
133.   		}
134.   
135. > 	num=sk_X509_num(ctx->chain);
136.   	x=sk_X509_value(ctx->chain,num-1);
137.   	depth=ctx->depth;

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.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_vfy.c:136:2: 
134.   
135.   	num=sk_X509_num(ctx->chain);
136. > 	x=sk_X509_value(ctx->chain,num-1);
137.   	depth=ctx->depth;
138.   

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > char *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.   char *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.   char *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.   char *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.   char *sk_set(STACK *st, int i, char *value)

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

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

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

crypto/x509/x509_vfy.c:150:3: 
148.   
149.   		/* If we are self signed, we break */
150. > 		xn=X509_get_issuer_name(x);
151.   		if (ctx->check_issued(ctx, x,x)) break;
152.   

crypto/x509/x509_cmp.c:119:1: start of procedure X509_get_issuer_name()
  117.   	}
  118.   
  119. > X509_NAME *X509_get_issuer_name(X509 *a)
  120.   	{
  121.   	return(a->cert_info->issuer);

crypto/x509/x509_cmp.c:121:2: 
  119.   X509_NAME *X509_get_issuer_name(X509 *a)
  120.   	{
  121. > 	return(a->cert_info->issuer);
  122.   	}
  123.   
