crypto/x509/x509_vfy.c:245: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 244 could be null and is dereferenced by call to `X509_get_subject_name()` at line 245, column 7.
Showing all 48 steps of the trace


crypto/x509/x509_vfy.c:153:1: start of procedure X509_verify_cert()
151.   #endif
152.   
153. > int X509_verify_cert(X509_STORE_CTX *ctx)
154.   	{
155.   	X509 *x,*xtmp,*chain_ss=NULL;

crypto/x509/x509_vfy.c:155:2: 
153.   int X509_verify_cert(X509_STORE_CTX *ctx)
154.   	{
155. > 	X509 *x,*xtmp,*chain_ss=NULL;
156.   	X509_NAME *xn;
157.   	int bad_chain = 0;

crypto/x509/x509_vfy.c:157:2: 
155.   	X509 *x,*xtmp,*chain_ss=NULL;
156.   	X509_NAME *xn;
157. > 	int bad_chain = 0;
158.   	X509_VERIFY_PARAM *param = ctx->param;
159.   	int depth,i,ok=0;

crypto/x509/x509_vfy.c:158:2: 
156.   	X509_NAME *xn;
157.   	int bad_chain = 0;
158. > 	X509_VERIFY_PARAM *param = ctx->param;
159.   	int depth,i,ok=0;
160.   	int num;

crypto/x509/x509_vfy.c:159:2: 
157.   	int bad_chain = 0;
158.   	X509_VERIFY_PARAM *param = ctx->param;
159. > 	int depth,i,ok=0;
160.   	int num;
161.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:162:2: 
160.   	int num;
161.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
162. > 	STACK_OF(X509) *sktmp=NULL;
163.   	if (ctx->cert == NULL)
164.   		{

crypto/x509/x509_vfy.c:163:6: Taking false branch
161.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
162.   	STACK_OF(X509) *sktmp=NULL;
163.   	if (ctx->cert == NULL)
            ^
164.   		{
165.   		X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);

crypto/x509/x509_vfy.c:169:2: 
167.   		}
168.   
169. > 	cb=ctx->verify_cb;
170.   
171.   	/* first we make sure the chain we are going to build is

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

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

crypto/x509/x509_vfy.c:193:6: Condition is true
191.   		}
192.   
193.   	num=sk_X509_num(ctx->chain);
            ^
194.   	x=sk_X509_value(ctx->chain,num-1);
195.   	depth=param->depth;

crypto/x509/x509_vfy.c:193:2: 
191.   		}
192.   
193. > 	num=sk_X509_num(ctx->chain);
194.   	x=sk_X509_value(ctx->chain,num-1);
195.   	depth=param->depth;

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:194:4: Condition is true
192.   
193.   	num=sk_X509_num(ctx->chain);
194.   	x=sk_X509_value(ctx->chain,num-1);
          ^
195.   	depth=param->depth;
196.   

crypto/x509/x509_vfy.c:194:2: 
192.   
193.   	num=sk_X509_num(ctx->chain);
194. > 	x=sk_X509_value(ctx->chain,num-1);
195.   	depth=param->depth;
196.   

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:303:2: 
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303. > 	return st->data[i];
  304.   }
  305.   

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:195:2: 
193.   	num=sk_X509_num(ctx->chain);
194.   	x=sk_X509_value(ctx->chain,num-1);
195. > 	depth=param->depth;
196.   
197.   

crypto/x509/x509_vfy.c:233:3: Loop condition is true. Entering loop body
231.   			}
232.   		break;
233.   		}
         ^
234.   
235.   	/* at this point, chain should contain a list of untrusted

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

crypto/x509/x509_vfy.c:208:3: 
206.   
207.   		/* If we are self signed, we break */
208. > 		xn=X509_get_issuer_name(x);
209.   		if (ctx->check_issued(ctx, x,x)) break;
210.   

crypto/x509/x509_cmp.c:131:1: start of procedure X509_get_issuer_name()
  129.   #endif
  130.   
  131. > X509_NAME *X509_get_issuer_name(X509 *a)
  132.   	{
  133.   	return(a->cert_info->issuer);

crypto/x509/x509_cmp.c:133:2: 
  131.   X509_NAME *X509_get_issuer_name(X509 *a)
  132.   	{
  133. > 	return(a->cert_info->issuer);
  134.   	}
  135.   

crypto/x509/x509_cmp.c:134:2: return from a call to X509_get_issuer_name
  132.   	{
  133.   	return(a->cert_info->issuer);
  134.   	}
          ^
  135.   
  136.   unsigned long X509_issuer_name_hash(X509 *x)

crypto/x509/x509_vfy.c:209:7: Taking true branch
207.   		/* If we are self signed, we break */
208.   		xn=X509_get_issuer_name(x);
209.   		if (ctx->check_issued(ctx, x,x)) break;
             ^
210.   
211.   		/* If we were passed a cert chain, use it first */

crypto/x509/x509_vfy.c:243:4: Condition is true
241.    	 */
242.   
243.   	i=sk_X509_num(ctx->chain);
          ^
244.   	x=sk_X509_value(ctx->chain,i-1);
245.   	xn = X509_get_subject_name(x);

crypto/x509/x509_vfy.c:243:2: 
241.    	 */
242.   
243. > 	i=sk_X509_num(ctx->chain);
244.   	x=sk_X509_value(ctx->chain,i-1);
245.   	xn = X509_get_subject_name(x);

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:244:4: Condition is true
242.   
243.   	i=sk_X509_num(ctx->chain);
244.   	x=sk_X509_value(ctx->chain,i-1);
          ^
245.   	xn = X509_get_subject_name(x);
246.   	if (ctx->check_issued(ctx, x, x))

crypto/x509/x509_vfy.c:244:2: 
242.   
243.   	i=sk_X509_num(ctx->chain);
244. > 	x=sk_X509_value(ctx->chain,i-1);
245.   	xn = X509_get_subject_name(x);
246.   	if (ctx->check_issued(ctx, x, x))

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking true branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:39: 
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:245:2: 
243.   	i=sk_X509_num(ctx->chain);
244.   	x=sk_X509_value(ctx->chain,i-1);
245. > 	xn = X509_get_subject_name(x);
246.   	if (ctx->check_issued(ctx, x, x))
247.   		{

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

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