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


crypto/x509/x509_vfy.c:647:1: start of procedure check_name_constraints()
645.   }
646.   
647. > static int check_name_constraints(X509_STORE_CTX *ctx)
648.   	{
649.   	X509 *x;

crypto/x509/x509_vfy.c:652:11: Condition is true
650.   	int i, j, rv;
651.   	/* Check name constraints for all certificates */
652.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
                 ^
653.   		{
654.   		x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:652:7: 
650.   	int i, j, rv;
651.   	/* Check name constraints for all certificates */
652. > 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
653.   		{
654.   		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:652:40: Loop condition is true. Entering loop body
650.   	int i, j, rv;
651.   	/* Check name constraints for all certificates */
652.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
                                              ^
653.   		{
654.   		x = sk_X509_value(ctx->chain, i);

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

crypto/x509/x509_vfy.c:654:3: 
652.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
653.   		{
654. > 		x = sk_X509_value(ctx->chain, i);
655.   		/* Ignore self issued certs unless last in chain */
656.   		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:656:7: Taking true branch
654.   		x = sk_X509_value(ctx->chain, i);
655.   		/* Ignore self issued certs unless last in chain */
656.   		if (i && (x->ex_flags & EXFLAG_SI))
             ^
657.   			continue;
658.   		/* Check against constraints for all certificates higher in

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

crypto/x509/x509_vfy.c:652:48: 
650.   	int i, j, rv;
651.   	/* Check name constraints for all certificates */
652. > 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
653.   		{
654.   		x = sk_X509_value(ctx->chain, i);

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

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

crypto/x509/x509_vfy.c:654:3: 
652.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
653.   		{
654. > 		x = sk_X509_value(ctx->chain, i);
655.   		/* Ignore self issued certs unless last in chain */
656.   		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:656:7: Taking true branch
654.   		x = sk_X509_value(ctx->chain, i);
655.   		/* Ignore self issued certs unless last in chain */
656.   		if (i && (x->ex_flags & EXFLAG_SI))
             ^
657.   			continue;
658.   		/* Check against constraints for all certificates higher in

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

crypto/x509/x509_vfy.c:663:12: Condition is true
661.   		 * assumed it expects them to be obeyed.
662.   		 */
663.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
                  ^
664.   			{
665.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/x509/x509_vfy.c:663:8: 
661.   		 * assumed it expects them to be obeyed.
662.   		 */
663. > 		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
664.   			{
665.   			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:663:41: Loop condition is true. Entering loop body
661.   		 * assumed it expects them to be obeyed.
662.   		 */
663.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
                                               ^
664.   			{
665.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

crypto/x509/x509_vfy.c:665:27: Condition is true
663.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
664.   			{
665.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
                                 ^
666.   			if (nc)
667.   				{

crypto/x509/x509_vfy.c:665:4: 
663.   		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
664.   			{
665. > 			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
666.   			if (nc)
667.   				{

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:666:8: Taking true branch
664.   			{
665.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
666.   			if (nc)
              ^
667.   				{
668.   				rv = NAME_CONSTRAINTS_check(x, nc);

crypto/x509/x509_vfy.c:668:5: Skipping NAME_CONSTRAINTS_check(): empty list of specs
666.   			if (nc)
667.   				{
668.   				rv = NAME_CONSTRAINTS_check(x, nc);
           ^
669.   				if (rv != X509_V_OK)
670.   					{

crypto/x509/x509_vfy.c:669:9: Taking true branch
667.   				{
668.   				rv = NAME_CONSTRAINTS_check(x, nc);
669.   				if (rv != X509_V_OK)
               ^
670.   					{
671.   					ctx->error = rv;

crypto/x509/x509_vfy.c:671:6: 
669.   				if (rv != X509_V_OK)
670.   					{
671. > 					ctx->error = rv;
672.   					ctx->error_depth = i;
673.   					ctx->current_cert = x;

crypto/x509/x509_vfy.c:672:6: 
670.   					{
671.   					ctx->error = rv;
672. > 					ctx->error_depth = i;
673.   					ctx->current_cert = x;
674.   					if (!ctx->verify_cb(0,ctx))

crypto/x509/x509_vfy.c:673:6: 
671.   					ctx->error = rv;
672.   					ctx->error_depth = i;
673. > 					ctx->current_cert = x;
674.   					if (!ctx->verify_cb(0,ctx))
675.   						return 0;

crypto/x509/x509_vfy.c:674:11: Taking false branch
672.   					ctx->error_depth = i;
673.   					ctx->current_cert = x;
674.   					if (!ctx->verify_cb(0,ctx))
                 ^
675.   						return 0;
676.   					}

crypto/x509/x509_vfy.c:663:48: 
661.   		 * assumed it expects them to be obeyed.
662.   		 */
663. > 		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
664.   			{
665.   			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;

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

crypto/x509/x509_vfy.c:652:48: 
650.   	int i, j, rv;
651.   	/* Check name constraints for all certificates */
652. > 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
653.   		{
654.   		x = sk_X509_value(ctx->chain, i);

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

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

crypto/x509/x509_vfy.c:654:3: 
652.   	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
653.   		{
654. > 		x = sk_X509_value(ctx->chain, i);
655.   		/* Ignore self issued certs unless last in chain */
656.   		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:656:7: Taking true branch
654.   		x = sk_X509_value(ctx->chain, i);
655.   		/* Ignore self issued certs unless last in chain */
656.   		if (i && (x->ex_flags & EXFLAG_SI))
             ^
657.   			continue;
658.   		/* Check against constraints for all certificates higher in

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

static int check_name_constraints(X509_STORE_CTX *ctx)
	{
	X509 *x;
	int i, j, rv;
	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
		{
		x = sk_X509_value(ctx->chain, i);
		if (i && (x->ex_flags & EXFLAG_SI))
			continue;
		for (j = sk_X509_num(ctx->chain) - 1; j > i; j--)
			{
			NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
			if (nc)
				{
				rv = NAME_CONSTRAINTS_check(x, nc);
				if (rv != X509_V_OK)
					{
					ctx->error = rv;
					ctx->error_depth = i;
					ctx->current_cert = x;
					if (!ctx->verify_cb(0,ctx))
						return 0;
					}
				}
			}
		}
	return 1;
	}
['static int check_name_constraints(X509_STORE_CTX *ctx)\n\t{\n\tX509 *x;\n\tint i, j, rv;\n\tfor (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)\n\t\t{\n\t\tx = sk_X509_value(ctx->chain, i);\n\t\tif (i && (x->ex_flags & EXFLAG_SI))\n\t\t\tcontinue;\n\t\tfor (j = sk_X509_num(ctx->chain) - 1; j > i; j--)\n\t\t\t{\n\t\t\tNAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;\n\t\t\tif (nc)\n\t\t\t\t{\n\t\t\t\trv = NAME_CONSTRAINTS_check(x, nc);\n\t\t\t\tif (rv != X509_V_OK)\n\t\t\t\t\t{\n\t\t\t\t\tctx->error = rv;\n\t\t\t\t\tctx->error_depth = i;\n\t\t\t\t\tctx->current_cert = x;\n\t\t\t\t\tif (!ctx->verify_cb(0,ctx))\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treturn 1;\n\t}', 'int sk_num(const _STACK *st)\n{\n\tif(st == NULL) return -1;\n\treturn st->num;\n}', 'void *sk_value(const _STACK *st, int i)\n{\n\tif(!st || (i < 0) || (i >= st->num)) return NULL;\n\treturn st->data[i];\n}']