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


crypto/x509/x509_cmp.c:394:1: start of procedure X509_chain_check_suiteb()
392.   }
393.   
394. > int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain,
395.                               unsigned long flags)
396.   {

crypto/x509/x509_cmp.c:398:5: 
396.   {
397.       int rv, i, sign_nid;
398. >     EVP_PKEY *pk = NULL;
399.       unsigned long tflags;
400.       if (!(flags & X509_V_FLAG_SUITEB_128_LOS))

crypto/x509/x509_cmp.c:400:11: Taking false branch
398.       EVP_PKEY *pk = NULL;
399.       unsigned long tflags;
400.       if (!(flags & X509_V_FLAG_SUITEB_128_LOS))
                 ^
401.           return X509_V_OK;
402.       tflags = flags;

crypto/x509/x509_cmp.c:402:5: 
400.       if (!(flags & X509_V_FLAG_SUITEB_128_LOS))
401.           return X509_V_OK;
402. >     tflags = flags;
403.       /* If no EE certificate passed in must be first in chain */
404.       if (x == NULL) {

crypto/x509/x509_cmp.c:404:9: Taking true branch
402.       tflags = flags;
403.       /* If no EE certificate passed in must be first in chain */
404.       if (x == NULL) {
               ^
405.           x = sk_X509_value(chain, 0);
406.           i = 1;

crypto/x509/x509_cmp.c:405:13: Condition is true
403.       /* If no EE certificate passed in must be first in chain */
404.       if (x == NULL) {
405.           x = sk_X509_value(chain, 0);
                   ^
406.           i = 1;
407.       } else

crypto/x509/x509_cmp.c:405:9: 
403.       /* If no EE certificate passed in must be first in chain */
404.       if (x == NULL) {
405. >         x = sk_X509_value(chain, 0);
406.           i = 1;
407.       } else

crypto/stack/stack.c:347:1: start of procedure sk_value()
  345.   }
  346.   
  347. > void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                  ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                         ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking true branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:350:9: 
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
  350. >         return NULL;
  351.       return st->data[i];
  352.   }

crypto/stack/stack.c:352:1: return from a call to sk_value
  350.           return NULL;
  351.       return st->data[i];
  352. > }
  353.   
  354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_cmp.c:406:9: 
404.       if (x == NULL) {
405.           x = sk_X509_value(chain, 0);
406. >         i = 1;
407.       } else
408.           i = 0;

crypto/x509/x509_cmp.c:410:9: 
408.           i = 0;
409.   
410. >     if (X509_get_version(x) != 2) {
411.           rv = X509_V_ERR_SUITE_B_INVALID_VERSION;
412.           /* Correct error depth */
