crypto/x509/x509_vfy.c:641: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 639 could be null and is dereferenced at line 641, column 13.
Showing all 66 steps of the trace


crypto/x509/x509_vfy.c:632:1: start of procedure check_name_constraints()
630.   }
631.   
632. > static int check_name_constraints(X509_STORE_CTX *ctx)
633.   	{
634.   	X509 *x;

crypto/x509/x509_vfy.c:637:11: Condition is true
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
                 ^
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:637:7: 
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637. > 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:637:40: Loop condition is true. Entering loop body
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
                                              ^
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:639:7: Condition is true
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);
             ^
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))

crypto/x509/x509_vfy.c:639:3: 
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639. > 		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:303:2: 
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303. > 	return st->data[i];
  304.   }
  305.   

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:641:7: Taking true branch
639.   		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))
             ^
642.   			continue;
643.   		/* Check against constraints for all certificates higher in

crypto/x509/x509_vfy.c:641:13: Taking true branch
639.   		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))
                   ^
642.   			continue;
643.   		/* Check against constraints for all certificates higher in

crypto/x509/x509_vfy.c:637:48: 
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637. > 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:637:40: Loop condition is true. Entering loop body
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
                                              ^
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:639:7: Condition is true
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);
             ^
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))

crypto/x509/x509_vfy.c:639:3: 
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639. > 		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:303:2: 
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303. > 	return st->data[i];
  304.   }
  305.   

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:641:7: Taking true branch
639.   		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))
             ^
642.   			continue;
643.   		/* Check against constraints for all certificates higher in

crypto/x509/x509_vfy.c:641:13: Taking false branch
639.   		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))
                   ^
642.   			continue;
643.   		/* Check against constraints for all certificates higher in

crypto/x509/x509_vfy.c:648:12: Condition is true
646.   		 * assumed it expects them to be obeyed.
647.   		 */
648.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
                  ^
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/x509/x509_vfy.c:648:8: 
646.   		 * assumed it expects them to be obeyed.
647.   		 */
648. > 		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/stack/stack.c:294:1: start of procedure sk_num()
  292.   	}
  293.   
  294. > int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;

crypto/stack/stack.c:296:5: Taking false branch
  294.   int sk_num(const _STACK *st)
  295.   {
  296.   	if(st == NULL) return -1;
             ^
  297.   	return st->num;
  298.   }

crypto/stack/stack.c:297:2: 
  295.   {
  296.   	if(st == NULL) return -1;
  297. > 	return st->num;
  298.   }
  299.   

crypto/stack/stack.c:298:1: return from a call to sk_num
  296.   	if(st == NULL) return -1;
  297.   	return st->num;
  298. > }
  299.   
  300.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:648:41: Loop condition is true. Entering loop body
646.   		 * assumed it expects them to be obeyed.
647.   		 */
648.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
                                               ^
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/x509/x509_vfy.c:650:27: Condition is true
648.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
                                 ^
651.   			if (nc)
652.   				{

crypto/x509/x509_vfy.c:650:4: 
648.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
649.   			{
650. > 			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
651.   			if (nc)
652.   				{

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:303:2: 
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303. > 	return st->data[i];
  304.   }
  305.   

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:651:8: Taking true branch
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
651.   			if (nc)
              ^
652.   				{
653.   				rv = NAME_CONSTRAINTS_check(x, nc);

crypto/x509/x509_vfy.c:653:5: Skipping NAME_CONSTRAINTS_check(): empty list of specs
651.   			if (nc)
652.   				{
653.   				rv = NAME_CONSTRAINTS_check(x, nc);
           ^
654.   				if (rv != X509_V_OK)
655.   					{

crypto/x509/x509_vfy.c:654:9: Taking true branch
652.   				{
653.   				rv = NAME_CONSTRAINTS_check(x, nc);
654.   				if (rv != X509_V_OK)
               ^
655.   					{
656.   					ctx->error = rv;

crypto/x509/x509_vfy.c:656:6: 
654.   				if (rv != X509_V_OK)
655.   					{
656. > 					ctx->error = rv;
657.   					ctx->error_depth = i;
658.   					ctx->current_cert = x;

crypto/x509/x509_vfy.c:657:6: 
655.   					{
656.   					ctx->error = rv;
657. > 					ctx->error_depth = i;
658.   					ctx->current_cert = x;
659.   					if (!ctx->verify_cb(0,ctx))

crypto/x509/x509_vfy.c:658:6: 
656.   					ctx->error = rv;
657.   					ctx->error_depth = i;
658. > 					ctx->current_cert = x;
659.   					if (!ctx->verify_cb(0,ctx))
660.   						return 0;

crypto/x509/x509_vfy.c:659:11: Taking false branch
657.   					ctx->error_depth = i;
658.   					ctx->current_cert = x;
659.   					if (!ctx->verify_cb(0,ctx))
                 ^
660.   						return 0;
661.   					}

crypto/x509/x509_vfy.c:648:48: 
646.   		 * assumed it expects them to be obeyed.
647.   		 */
648. > 		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/x509/x509_vfy.c:648:41: Loop condition is false. Leaving loop
646.   		 * assumed it expects them to be obeyed.
647.   		 */
648.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
                                               ^
649.   			{
650.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/x509/x509_vfy.c:637:48: 
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637. > 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:637:40: Loop condition is true. Entering loop body
635.   	int i, j, rv;
636.   	/* Check name constraints for all certificates */
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
                                              ^
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:639:7: Condition is true
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639.   		x = sk_X509_value(ctx->chain, i);
             ^
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))

crypto/x509/x509_vfy.c:639:3: 
637.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
638.   		{
639. > 		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking true branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:39: 
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:641:7: Taking true branch
639.   		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641.   		if (i && (x->ex_flags & EXFLAG_SI))
             ^
642.   			continue;
643.   		/* Check against constraints for all certificates higher in

crypto/x509/x509_vfy.c:641:13: 
639.   		x = sk_X509_value(ctx->chain, i);
640.   		/* Ignore self issued certs unless last in chain */
641. > 		if (i && (x->ex_flags & EXFLAG_SI))
642.   			continue;
643.   		/* Check against constraints for all certificates higher in
