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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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