crypto/x509/x509_vfy.c:535: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 533 could be null and is dereferenced at line 535, column 8.
Showing all 23 steps of the trace


crypto/x509/x509_vfy.c:489:1: start of procedure check_chain_extensions()
487.    */
488.   
489. > static int check_chain_extensions(X509_STORE_CTX *ctx)
490.   {
491.   #ifdef OPENSSL_NO_CHAIN_VERIFY

crypto/x509/x509_vfy.c:494:2: 
492.   	return 1;
493.   #else
494. > 	int i, ok=0, must_be_ca, plen = 0;
495.   	X509 *x;
496.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:497:2: 
495.   	X509 *x;
496.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
497. > 	int proxy_path_length = 0;
498.   	int purpose;
499.   	int allow_proxy_certs;

crypto/x509/x509_vfy.c:500:2: 
498.   	int purpose;
499.   	int allow_proxy_certs;
500. > 	cb=ctx->verify_cb;
501.   
502.   	/* must_be_ca can have 1 of 3 values:

crypto/x509/x509_vfy.c:510:2: 
508.   	       all certificates in the chain except the leaf certificate.
509.   	*/
510. > 	must_be_ca = -1;
511.   
512.   	/* CRL path validation */

crypto/x509/x509_vfy.c:513:6: Taking false branch
511.   
512.   	/* CRL path validation */
513.   	if (ctx->parent)
            ^
514.   		{
515.   		allow_proxy_certs = 0;

crypto/x509/x509_vfy.c:521:7: Condition is true
519.   		{
520.   		allow_proxy_certs =
521.   			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
             ^
522.   		/* A hack to keep people who don't want to modify their
523.   		   software happy */

crypto/x509/x509_vfy.c:521:4: 
519.   		{
520.   		allow_proxy_certs =
521. > 			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
522.   		/* A hack to keep people who don't want to modify their
523.   		   software happy */

crypto/x509/x509_vfy.c:520:3: 
518.   	else
519.   		{
520. > 		allow_proxy_certs =
521.   			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
522.   		/* A hack to keep people who don't want to modify their

crypto/x509/x509_vfy.c:524:7: Taking false branch
522.   		/* A hack to keep people who don't want to modify their
523.   		   software happy */
524.   		if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
             ^
525.   			allow_proxy_certs = 1;
526.   		purpose = ctx->param->purpose;

crypto/x509/x509_vfy.c:526:3: 
524.   		if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
525.   			allow_proxy_certs = 1;
526. > 		purpose = ctx->param->purpose;
527.   		}
528.   

crypto/x509/x509_vfy.c:530:7: 
528.   
529.   	/* Check all untrusted certificates */
530. > 	for (i = 0; i < ctx->last_untrusted; i++)
531.   		{
532.   		int ret;

crypto/x509/x509_vfy.c:530:14: Loop condition is true. Entering loop body
528.   
529.   	/* Check all untrusted certificates */
530.   	for (i = 0; i < ctx->last_untrusted; i++)
                    ^
531.   		{
532.   		int ret;

crypto/x509/x509_vfy.c:533:7: Condition is true
531.   		{
532.   		int ret;
533.   		x = sk_X509_value(ctx->chain, i);
             ^
534.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
535.   			&& (x->ex_flags & EXFLAG_CRITICAL))

crypto/x509/x509_vfy.c:533:3: 
531.   		{
532.   		int ret;
533. > 		x = sk_X509_value(ctx->chain, i);
534.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
535.   			&& (x->ex_flags & EXFLAG_CRITICAL))

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:534:9: Taking true branch
532.   		int ret;
533.   		x = sk_X509_value(ctx->chain, i);
534.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
535.   			&& (x->ex_flags & EXFLAG_CRITICAL))
536.   			{

crypto/x509/x509_vfy.c:535:8: 
533.   		x = sk_X509_value(ctx->chain, i);
534.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
535. > 			&& (x->ex_flags & EXFLAG_CRITICAL))
536.   			{
537.   			ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
