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


crypto/x509/x509_vfy.c:668:1: start of procedure internal_verify()
666.   	}
667.   
668. > static int internal_verify(X509_STORE_CTX *ctx)
669.   	{
670.   	int i,ok=0,n;

crypto/x509/x509_vfy.c:670:2: 
668.   static int internal_verify(X509_STORE_CTX *ctx)
669.   	{
670. > 	int i,ok=0,n;
671.   	X509 *xs,*xi;
672.   	EVP_PKEY *pkey=NULL;

crypto/x509/x509_vfy.c:672:2: 
670.   	int i,ok=0,n;
671.   	X509 *xs,*xi;
672. > 	EVP_PKEY *pkey=NULL;
673.   	time_t *ptime;
674.   	int (*cb)();

crypto/x509/x509_vfy.c:676:2: 
674.   	int (*cb)();
675.   
676. > 	cb=ctx->verify_cb;
677.   
678.   	n=sk_X509_num(ctx->chain);

crypto/x509/x509_vfy.c:678:2: 
676.   	cb=ctx->verify_cb;
677.   
678. > 	n=sk_X509_num(ctx->chain);
679.   	ctx->error_depth=n-1;
680.   	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.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_vfy.c:679:2: 
677.   
678.   	n=sk_X509_num(ctx->chain);
679. > 	ctx->error_depth=n-1;
680.   	n--;
681.   	xi=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:680:2: 
678.   	n=sk_X509_num(ctx->chain);
679.   	ctx->error_depth=n-1;
680. > 	n--;
681.   	xi=sk_X509_value(ctx->chain,n);
682.   	if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)

crypto/x509/x509_vfy.c:681:2: 
679.   	ctx->error_depth=n-1;
680.   	n--;
681. > 	xi=sk_X509_value(ctx->chain,n);
682.   	if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)
683.   		ptime = &ctx->check_time;

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > char *sk_value(const STACK *st, int i)
  309.   {
  310.   	if(st == NULL) return NULL;

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

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

crypto/x509/x509_vfy.c:682:6: Taking false branch
680.   	n--;
681.   	xi=sk_X509_value(ctx->chain,n);
682.   	if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)
            ^
683.   		ptime = &ctx->check_time;
684.   	else

crypto/x509/x509_vfy.c:685:3: 
683.   		ptime = &ctx->check_time;
684.   	else
685. > 		ptime = NULL;
686.   	if (ctx->check_issued(ctx, xi, xi))
687.   		xs=xi;

crypto/x509/x509_vfy.c:686:6: Taking false branch
684.   	else
685.   		ptime = NULL;
686.   	if (ctx->check_issued(ctx, xi, xi))
            ^
687.   		xs=xi;
688.   	else

crypto/x509/x509_vfy.c:690:7: Taking false branch
688.   	else
689.   		{
690.   		if (n <= 0)
             ^
691.   			{
692.   			ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;

crypto/x509/x509_vfy.c:699:4: 
697.   		else
698.   			{
699. > 			n--;
700.   			ctx->error_depth=n;
701.   			xs=sk_X509_value(ctx->chain,n);

crypto/x509/x509_vfy.c:700:4: 
698.   			{
699.   			n--;
700. > 			ctx->error_depth=n;
701.   			xs=sk_X509_value(ctx->chain,n);
702.   			}

crypto/x509/x509_vfy.c:701:4: 
699.   			n--;
700.   			ctx->error_depth=n;
701. > 			xs=sk_X509_value(ctx->chain,n);
702.   			}
703.   		}

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > char *sk_value(const STACK *st, int i)
  309.   {
  310.   	if(st == NULL) return NULL;

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

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

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

crypto/x509/x509_vfy.c:706:9: Loop condition is true. Entering loop body
704.   
705.   /*	ctx->error=0;  not needed */
706.   	while (n >= 0)
               ^
707.   		{
708.   		ctx->error_depth=n;

crypto/x509/x509_vfy.c:708:3: 
706.   	while (n >= 0)
707.   		{
708. > 		ctx->error_depth=n;
709.   		if (!xs->valid)
710.   			{

crypto/x509/x509_vfy.c:709:8: Taking false branch
707.   		{
708.   		ctx->error_depth=n;
709.   		if (!xs->valid)
              ^
710.   			{
711.   			if ((pkey=X509_get_pubkey(xi)) == NULL)
