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


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

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

crypto/stack/stack.c:211:5: 
    209.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    210.   {
    211. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    212.   }
    213.   

crypto/stack/stack.c:184:1: start of procedure internal_find()
      182.   }
      183.   
      184. > static int internal_find(OPENSSL_STACK *st, const void *data,
      185.                            int ret_val_options)
      186.   {

crypto/stack/stack.c:190:9: Taking false branch
      188.       int i;
      189.   
      190.       if (st == NULL)
                     ^
      191.           return -1;
      192.   

crypto/stack/stack.c:193:9: Taking true branch
      191.           return -1;
      192.   
      193.       if (st->comp == NULL) {
                     ^
      194.           for (i = 0; i < st->num; i++)
      195.               if (st->data[i] == data)

crypto/stack/stack.c:194:14: 
      192.   
      193.       if (st->comp == NULL) {
      194. >         for (i = 0; i < st->num; i++)
      195.               if (st->data[i] == data)
      196.                   return (i);

crypto/stack/stack.c:194:21: Loop condition is true. Entering loop body
      192.   
      193.       if (st->comp == NULL) {
      194.           for (i = 0; i < st->num; i++)
                                 ^
      195.               if (st->data[i] == data)
      196.                   return (i);

crypto/stack/stack.c:195:17: Taking false branch
      193.       if (st->comp == NULL) {
      194.           for (i = 0; i < st->num; i++)
      195.               if (st->data[i] == data)
                             ^
      196.                   return (i);
      197.           return (-1);

crypto/stack/stack.c:194:34: 
      192.   
      193.       if (st->comp == NULL) {
      194. >         for (i = 0; i < st->num; i++)
      195.               if (st->data[i] == data)
      196.                   return (i);

crypto/stack/stack.c:194:21: Loop condition is true. Entering loop body
      192.   
      193.       if (st->comp == NULL) {
      194.           for (i = 0; i < st->num; i++)
                                 ^
      195.               if (st->data[i] == data)
      196.                   return (i);

crypto/stack/stack.c:195:17: Taking true branch
      193.       if (st->comp == NULL) {
      194.           for (i = 0; i < st->num; i++)
      195.               if (st->data[i] == data)
                             ^
      196.                   return (i);
      197.           return (-1);

crypto/stack/stack.c:196:17: 
      194.           for (i = 0; i < st->num; i++)
      195.               if (st->data[i] == data)
      196. >                 return (i);
      197.           return (-1);
      198.       }

crypto/stack/stack.c:207:1: return from a call to internal_find
      205.           return (-1);
      206.       return (int)((const char **)r - st->data);
      207. > }
      208.   
      209.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

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

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

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

crypto/x509/x509_lu.c:567:19: 
565.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
566.           return sk_X509_OBJECT_value(h, idx);
567. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
568.           obj = sk_X509_OBJECT_value(h, i);
569.           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:277:1: start of procedure OPENSSL_sk_num()
    275.   }
    276.   
    277. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    278.   {
    279.       if (st == NULL)

crypto/stack/stack.c:279:9: Taking false branch
    277.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    278.   {
    279.       if (st == NULL)
                   ^
    280.           return -1;
    281.       return st->num;

crypto/stack/stack.c:281:5: 
    279.       if (st == NULL)
    280.           return -1;
    281. >     return st->num;
    282.   }
    283.   

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

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

crypto/stack/stack.c:286:9: Taking false branch
    284.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    287.           return NULL;
    288.       return (void *)st->data[i];

crypto/stack/stack.c:286:23: Taking true branch
    284.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    287.           return NULL;
    288.       return (void *)st->data[i];

crypto/stack/stack.c:287:9: 
    285.   {
    286.       if (st == NULL || i < 0 || i >= st->num)
    287. >         return NULL;
    288.       return (void *)st->data[i];
    289.   }

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

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

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