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


crypto/x509/x509_vfy.c:1068:1: start of procedure internal_verify()
1066.   	}
1067.   
1068. > static int internal_verify(X509_STORE_CTX *ctx)
1069.   	{
1070.   	int ok=0,n;

crypto/x509/x509_vfy.c:1070:2: 
1068.   static int internal_verify(X509_STORE_CTX *ctx)
1069.   	{
1070. > 	int ok=0,n;
1071.   	X509 *xs,*xi;
1072.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:1072:2: 
1070.   	int ok=0,n;
1071.   	X509 *xs,*xi;
1072. > 	EVP_PKEY *pkey=NULL;
1073.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1074.   

crypto/x509/x509_vfy.c:1075:2: 
1073.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1074.   
1075. > 	cb=ctx->verify_cb;
1076.   
1077.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:1077:2: 
1075.   	cb=ctx->verify_cb;
1076.   
1077. > 	n=sk_X509_num(ctx->chain);
1078.   	ctx->error_depth=n-1;
1079.   	n--;

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:1078:2: 
1076.   
1077.   	n=sk_X509_num(ctx->chain);
1078. > 	ctx->error_depth=n-1;
1079.   	n--;
1080.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1079:2: 
1077.   	n=sk_X509_num(ctx->chain);
1078.   	ctx->error_depth=n-1;
1079. > 	n--;
1080.   	xi=sk_X509_value(ctx->chain,n);
1081.   

crypto/x509/x509_vfy.c:1080:2: 
1078.   	ctx->error_depth=n-1;
1079.   	n--;
1080. > 	xi=sk_X509_value(ctx->chain,n);
1081.   
1082.   	if (ctx->check_issued(ctx, xi, xi))

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

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:1082:6: Taking false branch
1080.   	xi=sk_X509_value(ctx->chain,n);
1081.   
1082.   	if (ctx->check_issued(ctx, xi, xi))
             ^
1083.   		xs=xi;
1084.   	else

crypto/x509/x509_vfy.c:1086:7: Taking false branch
1084.   	else
1085.   		{
1086.   		if (n <= 0)
              ^
1087.   			{
1088.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:1095:4: 
1093.   		else
1094.   			{
1095. > 			n--;
1096.   			ctx->error_depth=n;
1097.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1096:4: 
1094.   			{
1095.   			n--;
1096. > 			ctx->error_depth=n;
1097.   			xs=sk_X509_value(ctx->chain,n);
1098.   			}

crypto/x509/x509_vfy.c:1097:4: 
1095.   			n--;
1096.   			ctx->error_depth=n;
1097. > 			xs=sk_X509_value(ctx->chain,n);
1098.   			}
1099.   		}

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 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:24: 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:1102:9: Loop condition is true. Entering loop body
1100.   
1101.   /*	ctx->error=0;  not needed */
1102.   	while (n >= 0)
                ^
1103.   		{
1104.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:1104:3: 
1102.   	while (n >= 0)
1103.   		{
1104. > 		ctx->error_depth=n;
1105.   		if (!xs->valid)
1106.   			{

crypto/x509/x509_vfy.c:1105:8: Taking false branch
1103.   		{
1104.   		ctx->error_depth=n;
1105.   		if (!xs->valid)
               ^
1106.   			{
1107.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
