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


crypto/x509/x509_lu.c:619:1: start of procedure X509_OBJECT_retrieve_match()
617.   }
618.   
619. > X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
620.                                           X509_OBJECT *x)
621.   {

crypto/x509/x509_lu.c:624:5: 
622.       int idx, i;
623.       X509_OBJECT *obj;
624. >     idx = sk_X509_OBJECT_find(h, x);
625.       if (idx == -1)
626.           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:316:1: start of procedure OPENSSL_sk_find()
    314.   }
    315.   
    316. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    317.   {
    318.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:318:5: 
    316.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    317.   {
    318. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    319.   }
    320.   

crypto/stack/stack.c:287:1: start of procedure internal_find()
      285.   }
      286.   
      287. > static int internal_find(OPENSSL_STACK *st, const void *data,
      288.                            int ret_val_options)
      289.   {

crypto/stack/stack.c:293:9: Taking false branch
      291.       int i;
      292.   
      293.       if (st == NULL || st->num == 0)
                     ^
      294.           return -1;
      295.   

crypto/stack/stack.c:293:23: Taking false branch
      291.       int i;
      292.   
      293.       if (st == NULL || st->num == 0)
                                   ^
      294.           return -1;
      295.   

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

crypto/stack/stack.c:297:14: 
      295.   
      296.       if (st->comp == NULL) {
      297. >         for (i = 0; i < st->num; i++)
      298.               if (st->data[i] == data)
      299.                   return i;

crypto/stack/stack.c:297:21: Loop condition is true. Entering loop body
      295.   
      296.       if (st->comp == NULL) {
      297.           for (i = 0; i < st->num; i++)
                                 ^
      298.               if (st->data[i] == data)
      299.                   return i;

crypto/stack/stack.c:298:17: Taking false branch
      296.       if (st->comp == NULL) {
      297.           for (i = 0; i < st->num; i++)
      298.               if (st->data[i] == data)
                             ^
      299.                   return i;
      300.           return -1;

crypto/stack/stack.c:297:34: 
      295.   
      296.       if (st->comp == NULL) {
      297. >         for (i = 0; i < st->num; i++)
      298.               if (st->data[i] == data)
      299.                   return i;

crypto/stack/stack.c:297:21: Loop condition is true. Entering loop body
      295.   
      296.       if (st->comp == NULL) {
      297.           for (i = 0; i < st->num; i++)
                                 ^
      298.               if (st->data[i] == data)
      299.                   return i;

crypto/stack/stack.c:298:17: Taking true branch
      296.       if (st->comp == NULL) {
      297.           for (i = 0; i < st->num; i++)
      298.               if (st->data[i] == data)
                             ^
      299.                   return i;
      300.           return -1;

crypto/stack/stack.c:299:17: 
      297.           for (i = 0; i < st->num; i++)
      298.               if (st->data[i] == data)
      299. >                 return i;
      300.           return -1;
      301.       }

crypto/stack/stack.c:314:1: return from a call to internal_find
      312.   
      313.       return r == NULL ? -1 : (int)((const void **)r - st->data);
      314. > }
      315.   
      316.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

crypto/stack/stack.c:319:1: return from a call to OPENSSL_sk_find
    317.   {
    318.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    319. > }
    320.   
    321.   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:625:9: Taking false branch
623.       X509_OBJECT *obj;
624.       idx = sk_X509_OBJECT_find(h, x);
625.       if (idx == -1)
               ^
626.           return NULL;
627.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))

crypto/x509/x509_lu.c:627:10: Taking false branch
625.       if (idx == -1)
626.           return NULL;
627.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
                ^
628.           return sk_X509_OBJECT_value(h, idx);
629.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {

crypto/x509/x509_lu.c:629:10: 
627.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
628.           return sk_X509_OBJECT_value(h, idx);
629. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
630.           obj = sk_X509_OBJECT_value(h, i);
631.           if (x509_object_cmp

crypto/x509/x509_lu.c:629:19: 
627.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
628.           return sk_X509_OBJECT_value(h, idx);
629. >     for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
630.           obj = sk_X509_OBJECT_value(h, i);
631.           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:380:1: start of procedure OPENSSL_sk_num()
    378.   }
    379.   
    380. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    381.   {
    382.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:382:12: Condition is false
    380.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    381.   {
    382.       return st == NULL ? -1 : st->num;
                      ^
    383.   }
    384.   

crypto/stack/stack.c:382:5: 
    380.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    381.   {
    382. >     return st == NULL ? -1 : st->num;
    383.   }
    384.   

crypto/stack/stack.c:383:1: return from a call to OPENSSL_sk_num
    381.   {
    382.       return st == NULL ? -1 : st->num;
    383. > }
    384.   
    385.   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:629:19: Loop condition is true. Entering loop body
627.       if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
628.           return sk_X509_OBJECT_value(h, idx);
629.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
                         ^
630.           obj = sk_X509_OBJECT_value(h, i);
631.           if (x509_object_cmp

crypto/x509/x509_lu.c:630:9: 
628.           return sk_X509_OBJECT_value(h, idx);
629.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
630. >         obj = sk_X509_OBJECT_value(h, i);
631.           if (x509_object_cmp
632.               ((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:385:1: start of procedure OPENSSL_sk_value()
    383.   }
    384.   
    385. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:387:9: Taking false branch
    385.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    388.           return NULL;
    389.       return (void *)st->data[i];

crypto/stack/stack.c:387:23: Taking true branch
    385.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    388.           return NULL;
    389.       return (void *)st->data[i];

crypto/stack/stack.c:388:9: 
    386.   {
    387.       if (st == NULL || i < 0 || i >= st->num)
    388. >         return NULL;
    389.       return (void *)st->data[i];
    390.   }

crypto/stack/stack.c:390:1: return from a call to OPENSSL_sk_value
    388.           return NULL;
    389.       return (void *)st->data[i];
    390. > }
    391.   
    392.   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:631:13: 
629.       for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
630.           obj = sk_X509_OBJECT_value(h, i);
631. >         if (x509_object_cmp
632.               ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
633.               return NULL;

crypto/x509/x509_lu.c:138:1: start of procedure x509_object_cmp()
  136.   
  137.   
  138. > static int x509_object_cmp(const X509_OBJECT *const *a,
  139.                              const X509_OBJECT *const *b)
  140.   {

crypto/x509/x509_lu.c:143:5: 
  141.       int ret;
  142.   
  143. >     ret = ((*a)->type - (*b)->type);
  144.       if (ret)
  145.           return ret;
