crypto/objects/obj_xref.c:141: error: NULL_DEREFERENCE
  pointer `*rv` last assigned on line 129 could be null and is dereferenced at line 141, column 20.
Showing all 38 steps of the trace


crypto/objects/obj_xref.c:117:1: start of procedure OBJ_find_sigid_by_algs()
115.   }
116.   
117. > int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid)
118.   {
119.       nid_triple tmp;

crypto/objects/obj_xref.c:120:5: 
118.   {
119.       nid_triple tmp;
120. >     const nid_triple *t = &tmp;
121.       const nid_triple **rv = NULL;
122.   

crypto/objects/obj_xref.c:121:5: 
119.       nid_triple tmp;
120.       const nid_triple *t = &tmp;
121. >     const nid_triple **rv = NULL;
122.   
123.       tmp.hash_id = dig_nid;

crypto/objects/obj_xref.c:123:5: 
121.       const nid_triple **rv = NULL;
122.   
123. >     tmp.hash_id = dig_nid;
124.       tmp.pkey_id = pkey_nid;
125.   

crypto/objects/obj_xref.c:124:5: 
122.   
123.       tmp.hash_id = dig_nid;
124. >     tmp.pkey_id = pkey_nid;
125.   
126.       if (sigx_app) {

crypto/objects/obj_xref.c:126:9: Taking true branch
124.       tmp.pkey_id = pkey_nid;
125.   
126.       if (sigx_app) {
               ^
127.           int idx = sk_nid_triple_find(sigx_app, &tmp);
128.           if (idx >= 0) {

crypto/objects/obj_xref.c:127:9: 
125.   
126.       if (sigx_app) {
127. >         int idx = sk_nid_triple_find(sigx_app, &tmp);
128.           if (idx >= 0) {
129.               t = sk_nid_triple_value(sigx_app, idx);

crypto/objects/obj_xref.h:9:1: start of procedure sk_nid_triple_find()
  7.   } nid_triple;
  8.   
  9. > DEFINE_STACK_OF(nid_triple)
  10.   
  11.   static const nid_triple sigoid_srt[] = {

crypto/stack/stack.c:249:1: start of procedure sk_find()
    247.   }
    248.   
    249. > int sk_find(_STACK *st, void *data)
    250.   {
    251.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:251:5: 
    249.   int sk_find(_STACK *st, void *data)
    250.   {
    251. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    252.   }
    253.   

crypto/stack/stack.c:225:1: start of procedure internal_find()
      223.   }
      224.   
      225. > static int internal_find(_STACK *st, void *data, int ret_val_options)
      226.   {
      227.       const void *const *r;

crypto/stack/stack.c:230:9: Taking false branch
      228.       int i;
      229.   
      230.       if (st == NULL)
                     ^
      231.           return -1;
      232.   

crypto/stack/stack.c:233:9: Taking true branch
      231.           return -1;
      232.   
      233.       if (st->comp == NULL) {
                     ^
      234.           for (i = 0; i < st->num; i++)
      235.               if (st->data[i] == data)

crypto/stack/stack.c:234:14: 
      232.   
      233.       if (st->comp == NULL) {
      234. >         for (i = 0; i < st->num; i++)
      235.               if (st->data[i] == data)
      236.                   return (i);

crypto/stack/stack.c:234:21: Loop condition is true. Entering loop body
      232.   
      233.       if (st->comp == NULL) {
      234.           for (i = 0; i < st->num; i++)
                                 ^
      235.               if (st->data[i] == data)
      236.                   return (i);

crypto/stack/stack.c:235:17: Taking false branch
      233.       if (st->comp == NULL) {
      234.           for (i = 0; i < st->num; i++)
      235.               if (st->data[i] == data)
                             ^
      236.                   return (i);
      237.           return (-1);

crypto/stack/stack.c:234:34: 
      232.   
      233.       if (st->comp == NULL) {
      234. >         for (i = 0; i < st->num; i++)
      235.               if (st->data[i] == data)
      236.                   return (i);

crypto/stack/stack.c:234:21: Loop condition is true. Entering loop body
      232.   
      233.       if (st->comp == NULL) {
      234.           for (i = 0; i < st->num; i++)
                                 ^
      235.               if (st->data[i] == data)
      236.                   return (i);

crypto/stack/stack.c:235:17: Taking true branch
      233.       if (st->comp == NULL) {
      234.           for (i = 0; i < st->num; i++)
      235.               if (st->data[i] == data)
                             ^
      236.                   return (i);
      237.           return (-1);

crypto/stack/stack.c:236:17: 
      234.           for (i = 0; i < st->num; i++)
      235.               if (st->data[i] == data)
      236. >                 return (i);
      237.           return (-1);
      238.       }

crypto/stack/stack.c:247:1: return from a call to internal_find
      245.           return (-1);
      246.       return (int)((char **)r - st->data);
      247. > }
      248.   
      249.   int sk_find(_STACK *st, void *data)

crypto/stack/stack.c:252:1: return from a call to sk_find
    250.   {
    251.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    252. > }
    253.   
    254.   int sk_find_ex(_STACK *st, void *data)

crypto/objects/obj_xref.h:9:1: return from a call to sk_nid_triple_find
  7.   } nid_triple;
  8.   
  9. > DEFINE_STACK_OF(nid_triple)
  10.   
  11.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.c:128:13: Taking true branch
126.       if (sigx_app) {
127.           int idx = sk_nid_triple_find(sigx_app, &tmp);
128.           if (idx >= 0) {
                   ^
129.               t = sk_nid_triple_value(sigx_app, idx);
130.               rv = &t;

crypto/objects/obj_xref.c:129:13: 
127.           int idx = sk_nid_triple_find(sigx_app, &tmp);
128.           if (idx >= 0) {
129. >             t = sk_nid_triple_value(sigx_app, idx);
130.               rv = &t;
131.           }

crypto/objects/obj_xref.h:9:1: start of procedure sk_nid_triple_value()
  7.   } nid_triple;
  8.   
  9. > DEFINE_STACK_OF(nid_triple)
  10.   
  11.   static const nid_triple sigoid_srt[] = {

crypto/stack/stack.c:324:1: start of procedure sk_value()
    322.   }
    323.   
    324. > void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:326:10: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                    ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:17: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                           ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:28: Taking true branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                                      ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:327:9: 
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
    327. >         return NULL;
    328.       return st->data[i];
    329.   }

crypto/stack/stack.c:329:1: return from a call to sk_value
    327.           return NULL;
    328.       return st->data[i];
    329. > }
    330.   
    331.   void *sk_set(_STACK *st, int i, void *value)

crypto/objects/obj_xref.h:9:1: return from a call to sk_nid_triple_value
  7.   } nid_triple;
  8.   
  9. > DEFINE_STACK_OF(nid_triple)
  10.   
  11.   static const nid_triple sigoid_srt[] = {

crypto/objects/obj_xref.c:130:13: 
128.           if (idx >= 0) {
129.               t = sk_nid_triple_value(sigx_app, idx);
130. >             rv = &t;
131.           }
132.       }

crypto/objects/obj_xref.c:134:9: Taking false branch
132.       }
133.   #ifndef OBJ_XREF_TEST2
134.       if (rv == NULL) {
               ^
135.           rv = OBJ_bsearch_sigx(&t, sigoid_srt_xref, OSSL_NELEM(sigoid_srt_xref));
136.       }

crypto/objects/obj_xref.c:138:9: Taking false branch
136.       }
137.   #endif
138.       if (rv == NULL)
               ^
139.           return 0;
140.       if (psignid)

crypto/objects/obj_xref.c:140:9: Taking true branch
138.       if (rv == NULL)
139.           return 0;
140.       if (psignid)
               ^
141.           *psignid = (*rv)->sign_id;
142.       return 1;

crypto/objects/obj_xref.c:141:9: 
139.           return 0;
140.       if (psignid)
141. >         *psignid = (*rv)->sign_id;
142.       return 1;
143.   }
