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


crypto/x509/x509_vfy.c:971:1: start of procedure internal_verify()
969.   	}
970.   
971. > static int internal_verify(X509_STORE_CTX *ctx)
972.   	{
973.   	int ok=0,n;

crypto/x509/x509_vfy.c:973:2: 
971.   static int internal_verify(X509_STORE_CTX *ctx)
972.   	{
973. > 	int ok=0,n;
974.   	X509 *xs,*xi;
975.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:975:2: 
973.   	int ok=0,n;
974.   	X509 *xs,*xi;
975. > 	EVP_PKEY *pkey=NULL;
976.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
977.   

crypto/x509/x509_vfy.c:978:2: 
976.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
977.   
978. > 	cb=ctx->verify_cb;
979.   
980.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:980:2: 
978.   	cb=ctx->verify_cb;
979.   
980. > 	n=sk_X509_num(ctx->chain);
981.   	ctx->error_depth=n-1;
982.   	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:981:2: 
979.   
980.   	n=sk_X509_num(ctx->chain);
981. > 	ctx->error_depth=n-1;
982.   	n--;
983.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:982:2: 
980.   	n=sk_X509_num(ctx->chain);
981.   	ctx->error_depth=n-1;
982. > 	n--;
983.   	xi=sk_X509_value(ctx->chain,n);
984.   

crypto/x509/x509_vfy.c:983:2: 
981.   	ctx->error_depth=n-1;
982.   	n--;
983. > 	xi=sk_X509_value(ctx->chain,n);
984.   
985.   	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:985:6: Taking false branch
983.   	xi=sk_X509_value(ctx->chain,n);
984.   
985.   	if (ctx->check_issued(ctx, xi, xi))
            ^
986.   		xs=xi;
987.   	else

crypto/x509/x509_vfy.c:989:7: Taking false branch
987.   	else
988.   		{
989.   		if (n <= 0)
             ^
990.   			{
991.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:998:4: 
996.   		else
997.   			{
998. > 			n--;
999.   			ctx->error_depth=n;
1000.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:999:4: 
997.   			{
998.   			n--;
999. > 			ctx->error_depth=n;
1000.   			xs=sk_X509_value(ctx->chain,n);
1001.   			}

crypto/x509/x509_vfy.c:1000:4: 
998.   			n--;
999.   			ctx->error_depth=n;
1000. > 			xs=sk_X509_value(ctx->chain,n);
1001.   			}
1002.   		}

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:1005:9: Loop condition is true. Entering loop body
1003.   
1004.   /*	ctx->error=0;  not needed */
1005.   	while (n >= 0)
                ^
1006.   		{
1007.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:1007:3: 
1005.   	while (n >= 0)
1006.   		{
1007. > 		ctx->error_depth=n;
1008.   		if (!xs->valid)
1009.   			{

crypto/x509/x509_vfy.c:1008:8: Taking false branch
1006.   		{
1007.   		ctx->error_depth=n;
1008.   		if (!xs->valid)
               ^
1009.   			{
1010.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
