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


crypto/x509/x509_vfy.c:627:1: start of procedure internal_verify()
625.   	}
626.   
627. > static int internal_verify(X509_STORE_CTX *ctx)
628.   	{
629.   	int i,ok=0,n;

crypto/x509/x509_vfy.c:629:2: 
627.   static int internal_verify(X509_STORE_CTX *ctx)
628.   	{
629. > 	int i,ok=0,n;
630.   	X509 *xs,*xi;
631.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:631:2: 
629.   	int i,ok=0,n;
630.   	X509 *xs,*xi;
631. > 	EVP_PKEY *pkey=NULL;
632.   	time_t *ptime;
633.   	int (*cb)();

crypto/x509/x509_vfy.c:635:2: 
633.   	int (*cb)();
634.   
635. > 	cb=ctx->verify_cb;
636.   
637.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:637:2: 
635.   	cb=ctx->verify_cb;
636.   
637. > 	n=sk_X509_num(ctx->chain);
638.   	ctx->error_depth=n-1;
639.   	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:638:2: 
636.   
637.   	n=sk_X509_num(ctx->chain);
638. > 	ctx->error_depth=n-1;
639.   	n--;
640.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:639:2: 
637.   	n=sk_X509_num(ctx->chain);
638.   	ctx->error_depth=n-1;
639. > 	n--;
640.   	xi=sk_X509_value(ctx->chain,n);
641.   	if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)

crypto/x509/x509_vfy.c:640:2: 
638.   	ctx->error_depth=n-1;
639.   	n--;
640. > 	xi=sk_X509_value(ctx->chain,n);
641.   	if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)
642.   		ptime = &ctx->check_time;

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 == NULL) return NULL;

crypto/stack/stack.c:309:5: Taking false branch
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309.   	if(st == NULL) return NULL;
             ^
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:310:2: 
  308.   {
  309.   	if(st == NULL) 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 == NULL) return NULL;
  310.   	return st->data[i];
  311. > }
  312.   
  313.   char *sk_set(STACK *st, int i, char *value)

crypto/x509/x509_vfy.c:641:6: Taking false branch
639.   	n--;
640.   	xi=sk_X509_value(ctx->chain,n);
641.   	if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)
            ^
642.   		ptime = &ctx->check_time;
643.   	else

crypto/x509/x509_vfy.c:644:3: 
642.   		ptime = &ctx->check_time;
643.   	else
644. > 		ptime = NULL;
645.   	if (ctx->check_issued(ctx, xi, xi))
646.   		xs=xi;

crypto/x509/x509_vfy.c:645:6: Taking false branch
643.   	else
644.   		ptime = NULL;
645.   	if (ctx->check_issued(ctx, xi, xi))
            ^
646.   		xs=xi;
647.   	else

crypto/x509/x509_vfy.c:649:7: Taking false branch
647.   	else
648.   		{
649.   		if (n <= 0)
             ^
650.   			{
651.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:658:4: 
656.   		else
657.   			{
658. > 			n--;
659.   			ctx->error_depth=n;
660.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:659:4: 
657.   			{
658.   			n--;
659. > 			ctx->error_depth=n;
660.   			xs=sk_X509_value(ctx->chain,n);
661.   			}

crypto/x509/x509_vfy.c:660:4: 
658.   			n--;
659.   			ctx->error_depth=n;
660. > 			xs=sk_X509_value(ctx->chain,n);
661.   			}
662.   		}

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 == NULL) return NULL;

crypto/stack/stack.c:309:5: Taking true branch
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309.   	if(st == NULL) return NULL;
             ^
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:309:17: 
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309. > 	if(st == NULL) return NULL;
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:311:1: return from a call to sk_value
  309.   	if(st == NULL) return NULL;
  310.   	return st->data[i];
  311. > }
  312.   
  313.   char *sk_set(STACK *st, int i, char *value)

crypto/x509/x509_vfy.c:665:9: Loop condition is true. Entering loop body
663.   
664.   /*	ctx->error=0;  not needed */
665.   	while (n >= 0)
               ^
666.   		{
667.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:667:3: 
665.   	while (n >= 0)
666.   		{
667. > 		ctx->error_depth=n;
668.   		if (!xs->valid)
669.   			{

crypto/x509/x509_vfy.c:668:8: Taking false branch
666.   		{
667.   		ctx->error_depth=n;
668.   		if (!xs->valid)
              ^
669.   			{
670.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
