crypto/x509/x509_lu.c:598: error: NULL_DEREFERENCE
  pointer `&obj` last assigned on line 597 could be null and is dereferenced by call to `x509_object_cmp()` at line 598, column 13.
Showing all 40 steps of the trace


crypto/x509/x509_lu.c:586:1: start of procedure X509_OBJECT_retrieve_match()
584.   }
585.   
586. > X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
587.                                           X509_OBJECT *x)
588.   {

crypto/x509/x509_lu.c:591:5: 
589.       int idx, i;
590.       X509_OBJECT *obj;
591. >     idx = sk_X509_OBJECT_find(h, x);
592.       if (idx == -1)
593.           return NULL;

include/openssl/x509_vfy.h:58:1: start of procedure sk_X509_OBJECT_find()
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/stack/stack.c:197:1: start of procedure OPENSSL_sk_find()
    195.   }
    196.   
    197. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    198.   {
    199.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:199:5: 
    197.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    198.   {
    199. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    200.   }
    201.   

crypto/stack/stack.c:172:1: start of procedure internal_find()
      170.   }
      171.   
      172. > static int internal_find(OPENSSL_STACK *st, const void *data,
      173.                            int ret_val_options)
      174.   {

crypto/stack/stack.c:178:9: Taking false branch
      176.       int i;
      177.   
      178.       if (st == NULL)
                     ^
      179.           return -1;
      180.   

crypto/stack/stack.c:181:9: Taking true branch
      179.           return -1;
      180.   
      181.       if (st->comp == NULL) {
                     ^
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)

crypto/stack/stack.c:182:14: 
      180.   
      181.       if (st->comp == NULL) {
      182. >         for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
      180.   
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
                                 ^
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:183:17: Taking false branch
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
                             ^
      184.                   return (i);
      185.           return (-1);

crypto/stack/stack.c:182:34: 
      180.   
      181.       if (st->comp == NULL) {
      182. >         for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
      180.   
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
                                 ^
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:183:17: Taking true branch
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
                             ^
      184.                   return (i);
      185.           return (-1);

crypto/stack/stack.c:184:17: 
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
      184. >                 return (i);
      185.           return (-1);
      186.       }

crypto/stack/stack.c:195:1: return from a call to internal_find
      193.           return (-1);
      194.       return (int)((char **)r - st->data);
      195. > }
      196.   
      197.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

crypto/stack/stack.c:200:1: return from a call to OPENSSL_sk_find
    198.   {
    199.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    200. > }
    201.   
    202.   int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)

include/openssl/x509_vfy.h:58:1: return from a call to sk_X509_OBJECT_find
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/x509/x509_lu.c:592:9: Taking false branch
590.       X509_OBJECT *obj;
591.       idx = sk_X509_OBJECT_find(h, x);
592.       if (idx == -1)
               ^
593.           return NULL;
594.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))

crypto/x509/x509_lu.c:594:10: Taking false branch
592.       if (idx == -1)
593.           return NULL;
594.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
                ^
595.           return sk_X509_OBJECT_value(h, idx);
596.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {

crypto/x509/x509_lu.c:596:10: 
594.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
595.           return sk_X509_OBJECT_value(h, idx);
596. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
597.           obj = sk_X509_OBJECT_value(h, i);
598.           if (x509_object_cmp

crypto/x509/x509_lu.c:596:19: 
594.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
595.           return sk_X509_OBJECT_value(h, idx);
596. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
597.           obj = sk_X509_OBJECT_value(h, i);
598.           if (x509_object_cmp

include/openssl/x509_vfy.h:58:1: start of procedure sk_X509_OBJECT_num()
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_num()
    263.   }
    264.   
    265. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)

crypto/stack/stack.c:267:9: Taking false branch
    265.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)
                   ^
    268.           return -1;
    269.       return st->num;

crypto/stack/stack.c:269:5: 
    267.       if (st == NULL)
    268.           return -1;
    269. >     return st->num;
    270.   }
    271.   

crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_num
    268.           return -1;
    269.       return st->num;
    270. > }
    271.   
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

include/openssl/x509_vfy.h:58:1: return from a call to sk_X509_OBJECT_num
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/x509/x509_lu.c:596:19: Loop condition is true. Entering loop body
594.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
595.           return sk_X509_OBJECT_value(h, idx);
596.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
                         ^
597.           obj = sk_X509_OBJECT_value(h, i);
598.           if (x509_object_cmp

crypto/x509/x509_lu.c:597:9: 
595.           return sk_X509_OBJECT_value(h, idx);
596.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
597. >         obj = sk_X509_OBJECT_value(h, i);
598.           if (x509_object_cmp
599.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))

include/openssl/x509_vfy.h:58:1: start of procedure sk_X509_OBJECT_value()
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/stack/stack.c:272:1: start of procedure OPENSSL_sk_value()
    270.   }
    271.   
    272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:274:9: Taking false branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:274:23: Taking true branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:275:9: 
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
    275. >         return NULL;
    276.       return st->data[i];
    277.   }

crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value
    275.           return NULL;
    276.       return st->data[i];
    277. > }
    278.   
    279.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value)

include/openssl/x509_vfy.h:58:1: return from a call to sk_X509_OBJECT_value
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/x509/x509_lu.c:598:13: 
596.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
597.           obj = sk_X509_OBJECT_value(h, i);
598. >         if (x509_object_cmp
599.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
600.               return NULL;

crypto/x509/x509_lu.c:120:1: start of procedure x509_object_cmp()
  118.   }
  119.   
  120. > static int x509_object_cmp(const X509_OBJECT *const *a,
  121.                              const X509_OBJECT *const *b)
  122.   {

crypto/x509/x509_lu.c:125:5: 
  123.       int ret;
  124.   
  125. >     ret = ((*a)->type - (*b)->type);
  126.       if (ret)
  127.           return ret;
