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


crypto/x509/x509_lu.c:578:1: start of procedure X509_OBJECT_retrieve_match()
576.   }
577.   
578. > X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
579.                                           X509_OBJECT *x)
580.   {

crypto/x509/x509_lu.c:583:5: 
581.       int idx, i;
582.       X509_OBJECT *obj;
583. >     idx = sk_X509_OBJECT_find(h, x);
584.       if (idx == -1)
585.           return NULL;

include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_find()
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

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:54:1: return from a call to sk_X509_OBJECT_find
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/x509/x509_lu.c:584:9: Taking false branch
582.       X509_OBJECT *obj;
583.       idx = sk_X509_OBJECT_find(h, x);
584.       if (idx == -1)
               ^
585.           return NULL;
586.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))

crypto/x509/x509_lu.c:586:10: Taking false branch
584.       if (idx == -1)
585.           return NULL;
586.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
                ^
587.           return sk_X509_OBJECT_value(h, idx);
588.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {

crypto/x509/x509_lu.c:588:10: 
586.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
587.           return sk_X509_OBJECT_value(h, idx);
588. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589.           obj = sk_X509_OBJECT_value(h, i);
590.           if (x509_object_cmp

crypto/x509/x509_lu.c:588:19: 
586.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
587.           return sk_X509_OBJECT_value(h, idx);
588. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589.           obj = sk_X509_OBJECT_value(h, i);
590.           if (x509_object_cmp

include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_num()
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

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:54:1: return from a call to sk_X509_OBJECT_num
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

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

crypto/x509/x509_lu.c:589:9: 
587.           return sk_X509_OBJECT_value(h, idx);
588.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589. >         obj = sk_X509_OBJECT_value(h, i);
590.           if (x509_object_cmp
591.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))

include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_value()
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

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:54:1: return from a call to sk_X509_OBJECT_value
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/x509/x509_lu.c:590:13: 
588.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589.           obj = sk_X509_OBJECT_value(h, i);
590. >         if (x509_object_cmp
591.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
592.               return NULL;

crypto/x509/x509_lu.c:109:1: start of procedure x509_object_cmp()
  107.   }
  108.   
  109. > static int x509_object_cmp(const X509_OBJECT *const *a,
  110.                              const X509_OBJECT *const *b)
  111.   {

crypto/x509/x509_lu.c:114:5: 
  112.       int ret;
  113.   
  114. >     ret = ((*a)->type - (*b)->type);
  115.       if (ret)
  116.           return ret;
