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


crypto/x509/x509_vfy.c:374:1: start of procedure check_chain_purpose()
372.    */
373.   
374. > static int check_chain_purpose(X509_STORE_CTX *ctx)
375.   {
376.   #ifdef OPENSSL_NO_CHAIN_VERIFY

crypto/x509/x509_vfy.c:379:2: 
377.   	return 1;
378.   #else
379. > 	int i, ok=0;
380.   	X509 *x;
381.   	int (*cb)();

crypto/x509/x509_vfy.c:382:2: 
380.   	X509 *x;
381.   	int (*cb)();
382. > 	cb=ctx->verify_cb;
383.   	/* Check all untrusted certificates */
384.   	for (i = 0; i < ctx->last_untrusted; i++)

crypto/x509/x509_vfy.c:384:7: 
382.   	cb=ctx->verify_cb;
383.   	/* Check all untrusted certificates */
384. > 	for (i = 0; i < ctx->last_untrusted; i++)
385.   		{
386.   		int ret;

crypto/x509/x509_vfy.c:384:14: Loop condition is true. Entering loop body
382.   	cb=ctx->verify_cb;
383.   	/* Check all untrusted certificates */
384.   	for (i = 0; i < ctx->last_untrusted; i++)
                    ^
385.   		{
386.   		int ret;

crypto/x509/x509_vfy.c:387:3: 
385.   		{
386.   		int ret;
387. > 		x = sk_X509_value(ctx->chain, i);
388.   		if (!(ctx->flags & X509_V_FLAG_IGNORE_CRITICAL)
389.   			&& (x->ex_flags & EXFLAG_CRITICAL))

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

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

crypto/stack/stack.c:310:17: 
  308.   char *sk_value(const STACK *st, int i)
  309.   {
  310. > 	if(st == NULL) return NULL;
  311.   	return st->data[i];
  312.   }

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

crypto/x509/x509_vfy.c:388:9: Taking true branch
386.   		int ret;
387.   		x = sk_X509_value(ctx->chain, i);
388.   		if (!(ctx->flags & X509_V_FLAG_IGNORE_CRITICAL)
               ^
389.   			&& (x->ex_flags & EXFLAG_CRITICAL))
390.   			{

crypto/x509/x509_vfy.c:389:8: 
387.   		x = sk_X509_value(ctx->chain, i);
388.   		if (!(ctx->flags & X509_V_FLAG_IGNORE_CRITICAL)
389. > 			&& (x->ex_flags & EXFLAG_CRITICAL))
390.   			{
391.   			ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
