crypto/x509/x509_vfy.c:459: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 449 could be null and is dereferenced at line 459, column 30.
Showing all 24 steps of the trace


crypto/x509/x509_vfy.c:405:1: start of procedure check_chain_extensions()
403.    */
404.   
405. > static int check_chain_extensions(X509_STORE_CTX *ctx)
406.   {
407.   #ifdef OPENSSL_NO_CHAIN_VERIFY

crypto/x509/x509_vfy.c:410:2: 
408.   	return 1;
409.   #else
410. > 	int i, ok=0, must_be_ca, plen = 0;
411.   	X509 *x;
412.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:413:2: 
411.   	X509 *x;
412.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
413. > 	int proxy_path_length = 0;
414.   	int purpose;
415.   	int allow_proxy_certs;

crypto/x509/x509_vfy.c:416:2: 
414.   	int purpose;
415.   	int allow_proxy_certs;
416. > 	cb=ctx->verify_cb;
417.   
418.   	/* must_be_ca can have 1 of 3 values:

crypto/x509/x509_vfy.c:426:2: 
424.   	       all certificates in the chain except the leaf certificate.
425.   	*/
426. > 	must_be_ca = -1;
427.   
428.   	/* CRL path validation */

crypto/x509/x509_vfy.c:429:6: Taking false branch
427.   
428.   	/* CRL path validation */
429.   	if (ctx->parent)
            ^
430.   		{
431.   		allow_proxy_certs = 0;

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

crypto/x509/x509_vfy.c:437:4: 
435.   		{
436.   		allow_proxy_certs =
437. > 			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
438.   		/* A hack to keep people who don't want to modify their
439.   		   software happy */

crypto/x509/x509_vfy.c:436:3: 
434.   	else
435.   		{
436. > 		allow_proxy_certs =
437.   			!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
438.   		/* A hack to keep people who don't want to modify their

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

crypto/x509/x509_vfy.c:442:3: 
440.   		if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
441.   			allow_proxy_certs = 1;
442. > 		purpose = ctx->param->purpose;
443.   		}
444.   

crypto/x509/x509_vfy.c:446:7: 
444.   
445.   	/* Check all untrusted certificates */
446. > 	for (i = 0; i < ctx->last_untrusted; i++)
447.   		{
448.   		int ret;

crypto/x509/x509_vfy.c:446:14: Loop condition is true. Entering loop body
444.   
445.   	/* Check all untrusted certificates */
446.   	for (i = 0; i < ctx->last_untrusted; i++)
                    ^
447.   		{
448.   		int ret;

crypto/x509/x509_vfy.c:449:7: Condition is true
447.   		{
448.   		int ret;
449.   		x = sk_X509_value(ctx->chain, i);
             ^
450.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
451.   			&& (x->ex_flags & EXFLAG_CRITICAL))

crypto/x509/x509_vfy.c:449:3: 
447.   		{
448.   		int ret;
449. > 		x = sk_X509_value(ctx->chain, i);
450.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
451.   			&& (x->ex_flags & EXFLAG_CRITICAL))

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:13: Taking false branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:24: Taking true branch
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  311.   	return st->data[i];
  312.   }

crypto/stack/stack.c:310:39: 
  308.   void *sk_value(const _STACK *st, int i)
  309.   {
  310. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  311.   	return st->data[i];
  312.   }

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

crypto/x509/x509_vfy.c:450:9: Taking false branch
448.   		int ret;
449.   		x = sk_X509_value(ctx->chain, i);
450.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
451.   			&& (x->ex_flags & EXFLAG_CRITICAL))
452.   			{

crypto/x509/x509_vfy.c:459:8: Taking true branch
457.   			if (!ok) goto end;
458.   			}
459.   		if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY))
              ^
460.   			{
461.   			ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;

crypto/x509/x509_vfy.c:459:30: 
457.   			if (!ok) goto end;
458.   			}
459. > 		if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY))
460.   			{
461.   			ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
