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


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

crypto/x509/x509_lu.c:561:5: 
559.       int idx, i;
560.       X509_OBJECT *obj;
561. >     idx = sk_X509_OBJECT_find(h, x);
562.       if (idx == -1)
563.           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:295:1: start of procedure OPENSSL_sk_find()
    293.   }
    294.   
    295. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    296.   {
    297.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:297:5: 
    295.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    296.   {
    297. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    298.   }
    299.   

crypto/stack/stack.c:266:1: start of procedure internal_find()
      264.   }
      265.   
      266. > static int internal_find(OPENSSL_STACK *st, const void *data,
      267.                            int ret_val_options)
      268.   {

crypto/stack/stack.c:272:9: Taking false branch
      270.       int i;
      271.   
      272.       if (st == NULL || st->num == 0)
                     ^
      273.           return -1;
      274.   

crypto/stack/stack.c:272:23: Taking false branch
      270.       int i;
      271.   
      272.       if (st == NULL || st->num == 0)
                                   ^
      273.           return -1;
      274.   

crypto/stack/stack.c:275:9: Taking true branch
      273.           return -1;
      274.   
      275.       if (st->comp == NULL) {
                     ^
      276.           for (i = 0; i < st->num; i++)
      277.               if (st->data[i] == data)

crypto/stack/stack.c:276:14: 
      274.   
      275.       if (st->comp == NULL) {
      276. >         for (i = 0; i < st->num; i++)
      277.               if (st->data[i] == data)
      278.                   return i;

crypto/stack/stack.c:276:21: Loop condition is true. Entering loop body
      274.   
      275.       if (st->comp == NULL) {
      276.           for (i = 0; i < st->num; i++)
                                 ^
      277.               if (st->data[i] == data)
      278.                   return i;

crypto/stack/stack.c:277:17: Taking false branch
      275.       if (st->comp == NULL) {
      276.           for (i = 0; i < st->num; i++)
      277.               if (st->data[i] == data)
                             ^
      278.                   return i;
      279.           return -1;

crypto/stack/stack.c:276:34: 
      274.   
      275.       if (st->comp == NULL) {
      276. >         for (i = 0; i < st->num; i++)
      277.               if (st->data[i] == data)
      278.                   return i;

crypto/stack/stack.c:276:21: Loop condition is true. Entering loop body
      274.   
      275.       if (st->comp == NULL) {
      276.           for (i = 0; i < st->num; i++)
                                 ^
      277.               if (st->data[i] == data)
      278.                   return i;

crypto/stack/stack.c:277:17: Taking true branch
      275.       if (st->comp == NULL) {
      276.           for (i = 0; i < st->num; i++)
      277.               if (st->data[i] == data)
                             ^
      278.                   return i;
      279.           return -1;

crypto/stack/stack.c:278:17: 
      276.           for (i = 0; i < st->num; i++)
      277.               if (st->data[i] == data)
      278. >                 return i;
      279.           return -1;
      280.       }

crypto/stack/stack.c:293:1: return from a call to internal_find
      291.   
      292.       return r == NULL ? -1 : (int)((const void **)r - st->data);
      293. > }
      294.   
      295.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

crypto/stack/stack.c:298:1: return from a call to OPENSSL_sk_find
    296.   {
    297.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    298. > }
    299.   
    300.   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:562:9: Taking false branch
560.       X509_OBJECT *obj;
561.       idx = sk_X509_OBJECT_find(h, x);
562.       if (idx == -1)
               ^
563.           return NULL;
564.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))

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

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

crypto/x509/x509_lu.c:566:19: 
564.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
565.           return sk_X509_OBJECT_value(h, idx);
566. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
567.           obj = sk_X509_OBJECT_value(h, i);
568.           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:359:1: start of procedure OPENSSL_sk_num()
    357.   }
    358.   
    359. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:361:12: Condition is false
    359.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361.       return st == NULL ? -1 : st->num;
                      ^
    362.   }
    363.   

crypto/stack/stack.c:361:5: 
    359.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361. >     return st == NULL ? -1 : st->num;
    362.   }
    363.   

crypto/stack/stack.c:362:1: return from a call to OPENSSL_sk_num
    360.   {
    361.       return st == NULL ? -1 : st->num;
    362. > }
    363.   
    364.   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:566:19: Loop condition is true. Entering loop body
564.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
565.           return sk_X509_OBJECT_value(h, idx);
566.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
                         ^
567.           obj = sk_X509_OBJECT_value(h, i);
568.           if (x509_object_cmp

crypto/x509/x509_lu.c:567:9: 
565.           return sk_X509_OBJECT_value(h, idx);
566.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
567. >         obj = sk_X509_OBJECT_value(h, i);
568.           if (x509_object_cmp
569.               ((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:364:1: start of procedure OPENSSL_sk_value()
    362.   }
    363.   
    364. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    365.   {
    366.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:366:9: Taking false branch
    364.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    365.   {
    366.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    367.           return NULL;
    368.       return (void *)st->data[i];

crypto/stack/stack.c:366:23: Taking true branch
    364.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    365.   {
    366.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    367.           return NULL;
    368.       return (void *)st->data[i];

crypto/stack/stack.c:367:9: 
    365.   {
    366.       if (st == NULL || i < 0 || i >= st->num)
    367. >         return NULL;
    368.       return (void *)st->data[i];
    369.   }

crypto/stack/stack.c:369:1: return from a call to OPENSSL_sk_value
    367.           return NULL;
    368.       return (void *)st->data[i];
    369. > }
    370.   
    371.   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:568:13: 
566.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
567.           obj = sk_X509_OBJECT_value(h, i);
568. >         if (x509_object_cmp
569.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
570.               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;
