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


crypto/x509/x509_vfy.c:394:1: start of procedure check_chain_extensions()
392.    */
393.   
394. > static int check_chain_extensions(X509_STORE_CTX *ctx)
395.   {
396.   #ifdef OPENSSL_NO_CHAIN_VERIFY

crypto/x509/x509_vfy.c:399:2: 
397.   	return 1;
398.   #else
399. > 	int i, ok=0, must_be_ca;
400.   	X509 *x;
401.   	int (*cb)(int xok,X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:402:2: 
400.   	X509 *x;
401.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
402. > 	int proxy_path_length = 0;
403.   	int allow_proxy_certs =
404.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);

crypto/x509/x509_vfy.c:404:6: Condition is true
402.   	int proxy_path_length = 0;
403.   	int allow_proxy_certs =
404.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
            ^
405.   	cb=ctx->verify_cb;
406.   

crypto/x509/x509_vfy.c:404:3: 
402.   	int proxy_path_length = 0;
403.   	int allow_proxy_certs =
404. > 		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
405.   	cb=ctx->verify_cb;
406.   

crypto/x509/x509_vfy.c:403:2: 
401.   	int (*cb)(int xok,X509_STORE_CTX *xctx);
402.   	int proxy_path_length = 0;
403. > 	int allow_proxy_certs =
404.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
405.   	cb=ctx->verify_cb;

crypto/x509/x509_vfy.c:405:2: 
403.   	int allow_proxy_certs =
404.   		!!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
405. > 	cb=ctx->verify_cb;
406.   
407.   	/* must_be_ca can have 1 of 3 values:

crypto/x509/x509_vfy.c:415:2: 
413.   	       all certificates in the chain except the leaf certificate.
414.   	*/
415. > 	must_be_ca = -1;
416.   
417.   	/* A hack to keep people who don't want to modify their software

crypto/x509/x509_vfy.c:419:6: Taking false branch
417.   	/* A hack to keep people who don't want to modify their software
418.   	   happy */
419.   	if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
            ^
420.   		allow_proxy_certs = 1;
421.   

crypto/x509/x509_vfy.c:423:7: 
421.   
422.   	/* Check all untrusted certificates */
423. > 	for (i = 0; i < ctx->last_untrusted; i++)
424.   		{
425.   		int ret;

crypto/x509/x509_vfy.c:423:14: Loop condition is true. Entering loop body
421.   
422.   	/* Check all untrusted certificates */
423.   	for (i = 0; i < ctx->last_untrusted; i++)
                    ^
424.   		{
425.   		int ret;

crypto/x509/x509_vfy.c:426:3: 
424.   		{
425.   		int ret;
426. > 		x = sk_X509_value(ctx->chain, i);
427.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
428.   			&& (x->ex_flags & EXFLAG_CRITICAL))

crypto/x509/x509.h:304:1: start of procedure sk_X509_value()
  302.   	} /* X509 */;
  303.   
  304. > DECLARE_STACK_OF(X509)
  305.   DECLARE_ASN1_SET_OF(X509)
  306.   

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 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.h:304:1: return from a call to sk_X509_value
  302.   	} /* X509 */;
  303.   
  304. > DECLARE_STACK_OF(X509)
  305.   DECLARE_ASN1_SET_OF(X509)
  306.   

crypto/x509/x509_vfy.c:427:9: Taking true branch
425.   		int ret;
426.   		x = sk_X509_value(ctx->chain, i);
427.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
428.   			&& (x->ex_flags & EXFLAG_CRITICAL))
429.   			{

crypto/x509/x509_vfy.c:428:8: 
426.   		x = sk_X509_value(ctx->chain, i);
427.   		if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
428. > 			&& (x->ex_flags & EXFLAG_CRITICAL))
429.   			{
430.   			ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
