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


crypto/x509/x509_cmp.c:402:1: start of procedure X509_chain_check_suiteb()
400.   	}
401.   
402. > int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain,
403.   							unsigned long flags)
404.   	{

crypto/x509/x509_cmp.c:406:2: 
404.   	{
405.   	int rv, i, sign_nid;
406. > 	EVP_PKEY *pk = NULL;
407.   	unsigned long tflags;
408.   	if (!(flags & X509_V_FLAG_SUITEB_128_LOS))

crypto/x509/x509_cmp.c:408:8: Taking false branch
406.   	EVP_PKEY *pk = NULL;
407.   	unsigned long tflags;
408.   	if (!(flags & X509_V_FLAG_SUITEB_128_LOS))
              ^
409.   		return X509_V_OK;
410.   	tflags = flags;

crypto/x509/x509_cmp.c:410:2: 
408.   	if (!(flags & X509_V_FLAG_SUITEB_128_LOS))
409.   		return X509_V_OK;
410. > 	tflags = flags;
411.   	/* If no EE certificate passed in must be first in chain */
412.   	if (x == NULL)

crypto/x509/x509_cmp.c:412:6: Taking true branch
410.   	tflags = flags;
411.   	/* If no EE certificate passed in must be first in chain */
412.   	if (x == NULL)
            ^
413.   		{
414.   		x = sk_X509_value(chain, 0);

crypto/x509/x509_cmp.c:414:7: Condition is true
412.   	if (x == NULL)
413.   		{
414.   		x = sk_X509_value(chain, 0);
             ^
415.   		i = 1;
416.   		}

crypto/x509/x509_cmp.c:414:3: 
412.   	if (x == NULL)
413.   		{
414. > 		x = sk_X509_value(chain, 0);
415.   		i = 1;
416.   		}

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:415:3: 
413.   		{
414.   		x = sk_X509_value(chain, 0);
415. > 		i = 1;
416.   		}
417.   	else

crypto/x509/x509_cmp.c:420:6: 
418.   		i = 0;
419.   
420. > 	if (X509_get_version(x) != 2)
421.   		{
422.   		rv = X509_V_ERR_SUITE_B_INVALID_VERSION;
