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


crypto/x509/x509_lu.c:553:1: start of procedure X509_OBJECT_retrieve_match()
551.   }
552.   
553. > X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
554.                                           X509_OBJECT *x)
555.   {

crypto/x509/x509_lu.c:558:5: 
556.       int idx, i;
557.       X509_OBJECT *obj;
558. >     idx = sk_X509_OBJECT_find(h, x);
559.       if (idx == -1)
560.           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:311:1: start of procedure OPENSSL_sk_find()
    309.   }
    310.   
    311. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    312.   {
    313.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:313:5: 
    311.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    312.   {
    313. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    314.   }
    315.   

crypto/stack/stack.c:282:1: start of procedure internal_find()
      280.   }
      281.   
      282. > static int internal_find(OPENSSL_STACK *st, const void *data,
      283.                            int ret_val_options)
      284.   {

crypto/stack/stack.c:288:9: Taking false branch
      286.       int i;
      287.   
      288.       if (st == NULL || st->num == 0)
                     ^
      289.           return -1;
      290.   

crypto/stack/stack.c:288:23: Taking false branch
      286.       int i;
      287.   
      288.       if (st == NULL || st->num == 0)
                                   ^
      289.           return -1;
      290.   

crypto/stack/stack.c:291:9: Taking true branch
      289.           return -1;
      290.   
      291.       if (st->comp == NULL) {
                     ^
      292.           for (i = 0; i < st->num; i++)
      293.               if (st->data[i] == data)

crypto/stack/stack.c:292:14: 
      290.   
      291.       if (st->comp == NULL) {
      292. >         for (i = 0; i < st->num; i++)
      293.               if (st->data[i] == data)
      294.                   return i;

crypto/stack/stack.c:292:21: Loop condition is true. Entering loop body
      290.   
      291.       if (st->comp == NULL) {
      292.           for (i = 0; i < st->num; i++)
                                 ^
      293.               if (st->data[i] == data)
      294.                   return i;

crypto/stack/stack.c:293:17: Taking false branch
      291.       if (st->comp == NULL) {
      292.           for (i = 0; i < st->num; i++)
      293.               if (st->data[i] == data)
                             ^
      294.                   return i;
      295.           return -1;

crypto/stack/stack.c:292:34: 
      290.   
      291.       if (st->comp == NULL) {
      292. >         for (i = 0; i < st->num; i++)
      293.               if (st->data[i] == data)
      294.                   return i;

crypto/stack/stack.c:292:21: Loop condition is true. Entering loop body
      290.   
      291.       if (st->comp == NULL) {
      292.           for (i = 0; i < st->num; i++)
                                 ^
      293.               if (st->data[i] == data)
      294.                   return i;

crypto/stack/stack.c:293:17: Taking true branch
      291.       if (st->comp == NULL) {
      292.           for (i = 0; i < st->num; i++)
      293.               if (st->data[i] == data)
                             ^
      294.                   return i;
      295.           return -1;

crypto/stack/stack.c:294:17: 
      292.           for (i = 0; i < st->num; i++)
      293.               if (st->data[i] == data)
      294. >                 return i;
      295.           return -1;
      296.       }

crypto/stack/stack.c:309:1: return from a call to internal_find
      307.   
      308.       return r == NULL ? -1 : (int)((const void **)r - st->data);
      309. > }
      310.   
      311.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

crypto/stack/stack.c:314:1: return from a call to OPENSSL_sk_find
    312.   {
    313.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    314. > }
    315.   
    316.   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:559:9: Taking false branch
557.       X509_OBJECT *obj;
558.       idx = sk_X509_OBJECT_find(h, x);
559.       if (idx == -1)
               ^
560.           return NULL;
561.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))

crypto/x509/x509_lu.c:561:10: Taking false branch
559.       if (idx == -1)
560.           return NULL;
561.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
                ^
562.           return sk_X509_OBJECT_value(h, idx);
563.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {

crypto/x509/x509_lu.c:563:10: 
561.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
562.           return sk_X509_OBJECT_value(h, idx);
563. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
564.           obj = sk_X509_OBJECT_value(h, i);
565.           if (x509_object_cmp

crypto/x509/x509_lu.c:563:19: 
561.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
562.           return sk_X509_OBJECT_value(h, idx);
563. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
564.           obj = sk_X509_OBJECT_value(h, i);
565.           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:375:1: start of procedure OPENSSL_sk_num()
    373.   }
    374.   
    375. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    376.   {
    377.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:377:12: Condition is false
    375.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    376.   {
    377.       return st == NULL ? -1 : st->num;
                      ^
    378.   }
    379.   

crypto/stack/stack.c:377:5: 
    375.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    376.   {
    377. >     return st == NULL ? -1 : st->num;
    378.   }
    379.   

crypto/stack/stack.c:378:1: return from a call to OPENSSL_sk_num
    376.   {
    377.       return st == NULL ? -1 : st->num;
    378. > }
    379.   
    380.   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:563:19: Loop condition is true. Entering loop body
561.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
562.           return sk_X509_OBJECT_value(h, idx);
563.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
                         ^
564.           obj = sk_X509_OBJECT_value(h, i);
565.           if (x509_object_cmp

crypto/x509/x509_lu.c:564:9: 
562.           return sk_X509_OBJECT_value(h, idx);
563.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
564. >         obj = sk_X509_OBJECT_value(h, i);
565.           if (x509_object_cmp
566.               ((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:380:1: start of procedure OPENSSL_sk_value()
    378.   }
    379.   
    380. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    381.   {
    382.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:382:9: Taking false branch
    380.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    381.   {
    382.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    383.           return NULL;
    384.       return (void *)st->data[i];

crypto/stack/stack.c:382:23: Taking true branch
    380.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    381.   {
    382.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    383.           return NULL;
    384.       return (void *)st->data[i];

crypto/stack/stack.c:383:9: 
    381.   {
    382.       if (st == NULL || i < 0 || i >= st->num)
    383. >         return NULL;
    384.       return (void *)st->data[i];
    385.   }

crypto/stack/stack.c:385:1: return from a call to OPENSSL_sk_value
    383.           return NULL;
    384.       return (void *)st->data[i];
    385. > }
    386.   
    387.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)

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:565:13: 
563.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
564.           obj = sk_X509_OBJECT_value(h, i);
565. >         if (x509_object_cmp
566.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
567.               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;
