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


crypto/x509/x509_vfy.c:544:1: start of procedure check_chain_extensions()
542.    */
543.   
544. > static int check_chain_extensions(X509_STORE_CTX *ctx)
545.   {
546.   #ifdef OPENSSL_NO_CHAIN_VERIFY

crypto/x509/x509_vfy.c:549:2: 
547.   	return 1;
548.   #else
549. > 	int i, ok=0, must_be_ca, plen = 0;
550.   	X509 *x;
551.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:552:2: 
550.   	X509 *x;
551.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
552. > 	int proxy_path_length = 0;
553.   	int purpose;
554.   	int allow_proxy_certs;

crypto/x509/x509_vfy.c:555:2: 
553.   	int purpose;
554.   	int allow_proxy_certs;
555. > 	cb=ctx->verify_cb;
556.   
557.   	/* must_be_ca can have 1 of 3 values:

crypto/x509/x509_vfy.c:565:2: 
563.   	       all certificates in the chain except the leaf certificate.
564.   	*/
565. > 	must_be_ca = -1;
566.   
567.   	/* CRL path validation */

crypto/x509/x509_vfy.c:568:6: Taking false branch
566.   
567.   	/* CRL path validation */
568.   	if (ctx->parent)
            ^
569.   		{
570.   		allow_proxy_certs = 0;

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

crypto/x509/x509_vfy.c:576:4: 
574.   		{
575.   		allow_proxy_certs =
576. > 			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
577.   		/* A hack to keep people who don't want to modify their
578.   		   software happy */

crypto/x509/x509_vfy.c:575:3: 
573.   	else
574.   		{
575. > 		allow_proxy_certs =
576.   			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
577.   		/* A hack to keep people who don't want to modify their

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

crypto/x509/x509_vfy.c:581:3: 
579.   		if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
580.   			allow_proxy_certs = 1;
581. > 		purpose = ctx->param->purpose;
582.   		}
583.   

crypto/x509/x509_vfy.c:585:7: 
583.   
584.   	/* Check all untrusted certificates */
585. > 	for (i = 0; i < ctx->last_untrusted; i++)
586.   		{
587.   		int ret;

crypto/x509/x509_vfy.c:585:14: Loop condition is true. Entering loop body
583.   
584.   	/* Check all untrusted certificates */
585.   	for (i = 0; i < ctx->last_untrusted; i++)
                    ^
586.   		{
587.   		int ret;

crypto/x509/x509_vfy.c:588:7: Condition is true
586.   		{
587.   		int ret;
588.   		x = sk_X509_value(ctx->chain, i);
             ^
589.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
590.   			&& (x->ex_flags & EXFLAG_CRITICAL))

crypto/x509/x509_vfy.c:588:3: 
586.   		{
587.   		int ret;
588. > 		x = sk_X509_value(ctx->chain, i);
589.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
590.   			&& (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:589:9: Taking true branch
587.   		int ret;
588.   		x = sk_X509_value(ctx->chain, i);
589.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
590.   			&& (x->ex_flags & EXFLAG_CRITICAL))
591.   			{

crypto/x509/x509_vfy.c:590:8: 
588.   		x = sk_X509_value(ctx->chain, i);
589.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
590. > 			&& (x->ex_flags & EXFLAG_CRITICAL))
591.   			{
592.   			ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
