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


crypto/x509/x509_vfy.c:384:1: start of procedure check_chain_extensions()
382.    */
383.   
384. > static int check_chain_extensions(X509_STORE_CTX *ctx)
385.   {
386.   #ifdef OPENSSL_NO_CHAIN_VERIFY

crypto/x509/x509_vfy.c:389:2: 
387.   	return 1;
388.   #else
389. > 	int i, ok=0, must_be_ca;
390.   	X509 *x;
391.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:392:2: 
390.   	X509 *x;
391.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
392. > 	int proxy_path_length = 0;
393.   	int allow_proxy_certs =
394.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);

crypto/x509/x509_vfy.c:394:6: Condition is true
392.   	int proxy_path_length = 0;
393.   	int allow_proxy_certs =
394.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
            ^
395.   	cb=ctx->verify_cb;
396.   

crypto/x509/x509_vfy.c:394:3: 
392.   	int proxy_path_length = 0;
393.   	int allow_proxy_certs =
394. > 		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
395.   	cb=ctx->verify_cb;
396.   

crypto/x509/x509_vfy.c:393:2: 
391.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
392.   	int proxy_path_length = 0;
393. > 	int allow_proxy_certs =
394.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
395.   	cb=ctx->verify_cb;

crypto/x509/x509_vfy.c:395:2: 
393.   	int allow_proxy_certs =
394.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
395. > 	cb=ctx->verify_cb;
396.   
397.   	/* must_be_ca can have 1 of 3 values:

crypto/x509/x509_vfy.c:405:2: 
403.   	       all certificates in the chain except the leaf certificate.
404.   	*/
405. > 	must_be_ca = -1;
406.   
407.   	/* A hack to keep people who don't want to modify their software

crypto/x509/x509_vfy.c:409:6: Taking false branch
407.   	/* A hack to keep people who don't want to modify their software
408.   	   happy */
409.   	if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
            ^
410.   		allow_proxy_certs = 1;
411.   

crypto/x509/x509_vfy.c:413:7: 
411.   
412.   	/* Check all untrusted certificates */
413. > 	for (i = 0; i < ctx->last_untrusted; i++)
414.   		{
415.   		int ret;

crypto/x509/x509_vfy.c:413:14: Loop condition is true. Entering loop body
411.   
412.   	/* Check all untrusted certificates */
413.   	for (i = 0; i < ctx->last_untrusted; i++)
                    ^
414.   		{
415.   		int ret;

crypto/x509/x509_vfy.c:416:3: 
414.   		{
415.   		int ret;
416. > 		x = sk_X509_value(ctx->chain, i);
417.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
418.   			&& (x->ex_flags & EXFLAG_CRITICAL))

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

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

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

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

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

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

crypto/x509/x509_vfy.c:417:9: Taking true branch
415.   		int ret;
416.   		x = sk_X509_value(ctx->chain, i);
417.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
418.   			&& (x->ex_flags & EXFLAG_CRITICAL))
419.   			{

crypto/x509/x509_vfy.c:418:8: 
416.   		x = sk_X509_value(ctx->chain, i);
417.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
418. > 			&& (x->ex_flags & EXFLAG_CRITICAL))
419.   			{
420.   			ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
