crypto/x509/x509_vfy.c:1188: error: NULL_DEREFERENCE
  pointer `xs` last assigned on line 1180 could be null and is dereferenced at line 1188, column 8.
Showing all 35 steps of the trace


crypto/x509/x509_vfy.c:1151:1: start of procedure internal_verify()
1149.   	}
1150.   
1151. > static int internal_verify(X509_STORE_CTX *ctx)
1152.   	{
1153.   	int ok=0,n;

crypto/x509/x509_vfy.c:1153:2: 
1151.   static int internal_verify(X509_STORE_CTX *ctx)
1152.   	{
1153. > 	int ok=0,n;
1154.   	X509 *xs,*xi;
1155.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:1155:2: 
1153.   	int ok=0,n;
1154.   	X509 *xs,*xi;
1155. > 	EVP_PKEY *pkey=NULL;
1156.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1157.   

crypto/x509/x509_vfy.c:1158:2: 
1156.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1157.   
1158. > 	cb=ctx->verify_cb;
1159.   
1160.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:1160:4: Condition is true
1158.   	cb=ctx->verify_cb;
1159.   
1160.   	n=sk_X509_num(ctx->chain);
           ^
1161.   	ctx->error_depth=n-1;
1162.   	n--;

crypto/x509/x509_vfy.c:1160:2: 
1158.   	cb=ctx->verify_cb;
1159.   
1160. > 	n=sk_X509_num(ctx->chain);
1161.   	ctx->error_depth=n-1;
1162.   	n--;

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:1161:2: 
1159.   
1160.   	n=sk_X509_num(ctx->chain);
1161. > 	ctx->error_depth=n-1;
1162.   	n--;
1163.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1162:2: 
1160.   	n=sk_X509_num(ctx->chain);
1161.   	ctx->error_depth=n-1;
1162. > 	n--;
1163.   	xi=sk_X509_value(ctx->chain,n);
1164.   

crypto/x509/x509_vfy.c:1163:5: Condition is true
1161.   	ctx->error_depth=n-1;
1162.   	n--;
1163.   	xi=sk_X509_value(ctx->chain,n);
            ^
1164.   
1165.   	if (ctx->check_issued(ctx, xi, xi))

crypto/x509/x509_vfy.c:1163:2: 
1161.   	ctx->error_depth=n-1;
1162.   	n--;
1163. > 	xi=sk_X509_value(ctx->chain,n);
1164.   
1165.   	if (ctx->check_issued(ctx, xi, xi))

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 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:24: 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:311:2: 
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311. > 	return st->data[i];
  312.   }
  313.   

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:1165:6: Taking false branch
1163.   	xi=sk_X509_value(ctx->chain,n);
1164.   
1165.   	if (ctx->check_issued(ctx, xi, xi))
             ^
1166.   		xs=xi;
1167.   	else

crypto/x509/x509_vfy.c:1169:7: Taking false branch
1167.   	else
1168.   		{
1169.   		if (n <= 0)
              ^
1170.   			{
1171.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:1178:4: 
1176.   		else
1177.   			{
1178. > 			n--;
1179.   			ctx->error_depth=n;
1180.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1179:4: 
1177.   			{
1178.   			n--;
1179. > 			ctx->error_depth=n;
1180.   			xs=sk_X509_value(ctx->chain,n);
1181.   			}

crypto/x509/x509_vfy.c:1180:7: Condition is true
1178.   			n--;
1179.   			ctx->error_depth=n;
1180.   			xs=sk_X509_value(ctx->chain,n);
              ^
1181.   			}
1182.   		}

crypto/x509/x509_vfy.c:1180:4: 
1178.   			n--;
1179.   			ctx->error_depth=n;
1180. > 			xs=sk_X509_value(ctx->chain,n);
1181.   			}
1182.   		}

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 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:24: 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:1185:9: Loop condition is true. Entering loop body
1183.   
1184.   /*	ctx->error=0;  not needed */
1185.   	while (n >= 0)
                ^
1186.   		{
1187.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:1187:3: 
1185.   	while (n >= 0)
1186.   		{
1187. > 		ctx->error_depth=n;
1188.   		if (!xs->valid)
1189.   			{

crypto/x509/x509_vfy.c:1188:8: Taking false branch
1186.   		{
1187.   		ctx->error_depth=n;
1188.   		if (!xs->valid)
               ^
1189.   			{
1190.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
