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


crypto/x509/x509_vfy.c:1574:1: start of procedure internal_verify()
1572.   	}
1573.   
1574. > static int internal_verify(X509_STORE_CTX *ctx)
1575.   	{
1576.   	int ok=0,n;

crypto/x509/x509_vfy.c:1576:2: 
1574.   static int internal_verify(X509_STORE_CTX *ctx)
1575.   	{
1576. > 	int ok=0,n;
1577.   	X509 *xs,*xi;
1578.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:1578:2: 
1576.   	int ok=0,n;
1577.   	X509 *xs,*xi;
1578. > 	EVP_PKEY *pkey=NULL;
1579.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1580.   

crypto/x509/x509_vfy.c:1581:2: 
1579.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
1580.   
1581. > 	cb=ctx->verify_cb;
1582.   
1583.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:1583:4: Condition is true
1581.   	cb=ctx->verify_cb;
1582.   
1583.   	n=sk_X509_num(ctx->chain);
           ^
1584.   	ctx->error_depth=n-1;
1585.   	n--;

crypto/x509/x509_vfy.c:1583:2: 
1581.   	cb=ctx->verify_cb;
1582.   
1583. > 	n=sk_X509_num(ctx->chain);
1584.   	ctx->error_depth=n-1;
1585.   	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:1584:2: 
1582.   
1583.   	n=sk_X509_num(ctx->chain);
1584. > 	ctx->error_depth=n-1;
1585.   	n--;
1586.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1585:2: 
1583.   	n=sk_X509_num(ctx->chain);
1584.   	ctx->error_depth=n-1;
1585. > 	n--;
1586.   	xi=sk_X509_value(ctx->chain,n);
1587.   

crypto/x509/x509_vfy.c:1586:5: Condition is true
1584.   	ctx->error_depth=n-1;
1585.   	n--;
1586.   	xi=sk_X509_value(ctx->chain,n);
            ^
1587.   
1588.   	if (ctx->check_issued(ctx, xi, xi))

crypto/x509/x509_vfy.c:1586:2: 
1584.   	ctx->error_depth=n-1;
1585.   	n--;
1586. > 	xi=sk_X509_value(ctx->chain,n);
1587.   
1588.   	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:1588:6: Taking false branch
1586.   	xi=sk_X509_value(ctx->chain,n);
1587.   
1588.   	if (ctx->check_issued(ctx, xi, xi))
             ^
1589.   		xs=xi;
1590.   	else

crypto/x509/x509_vfy.c:1592:7: Taking false branch
1590.   	else
1591.   		{
1592.   		if (n <= 0)
              ^
1593.   			{
1594.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:1601:4: 
1599.   		else
1600.   			{
1601. > 			n--;
1602.   			ctx->error_depth=n;
1603.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:1602:4: 
1600.   			{
1601.   			n--;
1602. > 			ctx->error_depth=n;
1603.   			xs=sk_X509_value(ctx->chain,n);
1604.   			}

crypto/x509/x509_vfy.c:1603:7: Condition is true
1601.   			n--;
1602.   			ctx->error_depth=n;
1603.   			xs=sk_X509_value(ctx->chain,n);
              ^
1604.   			}
1605.   		}

crypto/x509/x509_vfy.c:1603:4: 
1601.   			n--;
1602.   			ctx->error_depth=n;
1603. > 			xs=sk_X509_value(ctx->chain,n);
1604.   			}
1605.   		}

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:1608:9: Loop condition is true. Entering loop body
1606.   
1607.   /*	ctx->error=0;  not needed */
1608.   	while (n >= 0)
                ^
1609.   		{
1610.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:1610:3: 
1608.   	while (n >= 0)
1609.   		{
1610. > 		ctx->error_depth=n;
1611.   		if (!xs->valid)
1612.   			{

crypto/x509/x509_vfy.c:1611:8: Taking false branch
1609.   		{
1610.   		ctx->error_depth=n;
1611.   		if (!xs->valid)
               ^
1612.   			{
1613.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
