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


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

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:418:3: 
416.   		{
417.   		int ret;
418. > 		x = sk_X509_value(ctx->chain, i);
419.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
420.   			&& (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:419:9: Taking false branch
417.   		int ret;
418.   		x = sk_X509_value(ctx->chain, i);
419.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
420.   			&& (x->ex_flags & EXFLAG_CRITICAL))
421.   			{

crypto/x509/x509_vfy.c:428:8: Taking true branch
426.   			if (!ok) goto end;
427.   			}
428.   		if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY))
              ^
429.   			{
430.   			ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;

crypto/x509/x509_vfy.c:428:30: 
426.   			if (!ok) goto end;
427.   			}
428. > 		if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY))
429.   			{
430.   			ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
