crypto/x509/x509_cmp.c:405: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 399 could be null and is dereferenced at line 405, column 6.
Showing all 15 steps of the trace


crypto/x509/x509_cmp.c:387:1: start of procedure X509_chain_check_suiteb()
385.   	}
386.   
387. > int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain,
388.   							unsigned long flags)
389.   	{

crypto/x509/x509_cmp.c:391:2: 
389.   	{
390.   	int rv, i, sign_nid;
391. > 	EVP_PKEY *pk = NULL;
392.   	unsigned long tflags;
393.   	if (!(flags & X509_V_FLAG_SUITEB_128_LOS))

crypto/x509/x509_cmp.c:393:8: Taking false branch
391.   	EVP_PKEY *pk = NULL;
392.   	unsigned long tflags;
393.   	if (!(flags & X509_V_FLAG_SUITEB_128_LOS))
              ^
394.   		return X509_V_OK;
395.   	tflags = flags;

crypto/x509/x509_cmp.c:395:2: 
393.   	if (!(flags & X509_V_FLAG_SUITEB_128_LOS))
394.   		return X509_V_OK;
395. > 	tflags = flags;
396.   	/* If no EE certificate passed in must be first in chain */
397.   	if (x == NULL)

crypto/x509/x509_cmp.c:397:6: Taking true branch
395.   	tflags = flags;
396.   	/* If no EE certificate passed in must be first in chain */
397.   	if (x == NULL)
            ^
398.   		{
399.   		x = sk_X509_value(chain, 0);

crypto/x509/x509_cmp.c:399:7: Condition is true
397.   	if (x == NULL)
398.   		{
399.   		x = sk_X509_value(chain, 0);
             ^
400.   		i = 1;
401.   		}

crypto/x509/x509_cmp.c:399:3: 
397.   	if (x == NULL)
398.   		{
399. > 		x = sk_X509_value(chain, 0);
400.   		i = 1;
401.   		}

crypto/stack/stack.c:300:1: start of procedure sk_value()
  298.   }
  299.   
  300. > void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:13: Taking false branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:24: Taking true branch
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:302:39: 
  300.   void *sk_value(const _STACK *st, int i)
  301.   {
  302. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
  302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  303.   	return st->data[i];
  304. > }
  305.   
  306.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_cmp.c:400:3: 
398.   		{
399.   		x = sk_X509_value(chain, 0);
400. > 		i = 1;
401.   		}
402.   	else

crypto/x509/x509_cmp.c:405:6: 
403.   		i = 0;
404.   
405. > 	if (X509_get_version(x) != 2)
406.   		{
407.   		rv = X509_V_ERR_SUITE_B_INVALID_VERSION;
