crypto/x509/x509_trs.c:134: error: NULL_DEREFERENCE
  pointer `pt` last assigned on line 133 could be null and is dereferenced at line 134, column 12.
Showing all 41 steps of the trace


crypto/x509/x509_trs.c:116:1: start of procedure X509_check_trust()
114.   }
115.   
116. > int X509_check_trust(X509 *x, int id, int flags)
117.   {
118.       X509_TRUST *pt;

crypto/x509/x509_trs.c:120:9: Taking false branch
118.       X509_TRUST *pt;
119.       int idx;
120.       if (id == -1)
               ^
121.           return 1;
122.       /* We get this as a default value */

crypto/x509/x509_trs.c:123:9: Taking false branch
121.           return 1;
122.       /* We get this as a default value */
123.       if (id == 0) {
               ^
124.           int rv;
125.           rv = obj_trust(NID_anyExtendedKeyUsage, x, 0);

crypto/x509/x509_trs.c:130:5: 
128.           return trust_compat(NULL, x, 0);
129.       }
130. >     idx = X509_TRUST_get_by_id(id);
131.       if (idx == -1)
132.           return default_trust(id, x, flags);

crypto/x509/x509_trs.c:153:1: start of procedure X509_TRUST_get_by_id()
  151.   }
  152.   
  153. > int X509_TRUST_get_by_id(int id)
  154.   {
  155.       X509_TRUST tmp;

crypto/x509/x509_trs.c:157:10: Taking true branch
  155.       X509_TRUST tmp;
  156.       int idx;
  157.       if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
                  ^
  158.           return id - X509_TRUST_MIN;
  159.       tmp.trust = id;

crypto/x509/x509_trs.c:157:36: Taking false branch
  155.       X509_TRUST tmp;
  156.       int idx;
  157.       if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
                                            ^
  158.           return id - X509_TRUST_MIN;
  159.       tmp.trust = id;

crypto/x509/x509_trs.c:159:5: 
  157.       if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
  158.           return id - X509_TRUST_MIN;
  159. >     tmp.trust = id;
  160.       if (!trtable)
  161.           return -1;

crypto/x509/x509_trs.c:160:10: Taking false branch
  158.           return id - X509_TRUST_MIN;
  159.       tmp.trust = id;
  160.       if (!trtable)
                  ^
  161.           return -1;
  162.       idx = sk_X509_TRUST_find(trtable, &tmp);

crypto/x509/x509_trs.c:162:11: Condition is true
  160.       if (!trtable)
  161.           return -1;
  162.       idx = sk_X509_TRUST_find(trtable, &tmp);
                   ^
  163.       if (idx == -1)
  164.           return -1;

crypto/x509/x509_trs.c:162:11: Condition is true
  160.       if (!trtable)
  161.           return -1;
  162.       idx = sk_X509_TRUST_find(trtable, &tmp);
                   ^
  163.       if (idx == -1)
  164.           return -1;

crypto/x509/x509_trs.c:162:5: 
  160.       if (!trtable)
  161.           return -1;
  162. >     idx = sk_X509_TRUST_find(trtable, &tmp);
  163.       if (idx == -1)
  164.           return -1;

crypto/stack/stack.c:271:1: start of procedure sk_find()
    269.   }
    270.   
    271. > int sk_find(_STACK *st, void *data)
    272.   {
    273.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:273:5: 
    271.   int sk_find(_STACK *st, void *data)
    272.   {
    273. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    274.   }
    275.   

crypto/stack/stack.c:247:1: start of procedure internal_find()
      245.   }
      246.   
      247. > static int internal_find(_STACK *st, void *data, int ret_val_options)
      248.   {
      249.       const void *const *r;

crypto/stack/stack.c:252:9: Taking false branch
      250.       int i;
      251.   
      252.       if (st == NULL)
                     ^
      253.           return -1;
      254.   

crypto/stack/stack.c:255:9: Taking true branch
      253.           return -1;
      254.   
      255.       if (st->comp == NULL) {
                     ^
      256.           for (i = 0; i < st->num; i++)
      257.               if (st->data[i] == data)

crypto/stack/stack.c:256:14: 
      254.   
      255.       if (st->comp == NULL) {
      256. >         for (i = 0; i < st->num; i++)
      257.               if (st->data[i] == data)
      258.                   return (i);

crypto/stack/stack.c:256:21: Loop condition is true. Entering loop body
      254.   
      255.       if (st->comp == NULL) {
      256.           for (i = 0; i < st->num; i++)
                                 ^
      257.               if (st->data[i] == data)
      258.                   return (i);

crypto/stack/stack.c:257:17: Taking true branch
      255.       if (st->comp == NULL) {
      256.           for (i = 0; i < st->num; i++)
      257.               if (st->data[i] == data)
                             ^
      258.                   return (i);
      259.           return (-1);

crypto/stack/stack.c:258:17: 
      256.           for (i = 0; i < st->num; i++)
      257.               if (st->data[i] == data)
      258. >                 return (i);
      259.           return (-1);
      260.       }

crypto/stack/stack.c:269:1: return from a call to internal_find
      267.           return (-1);
      268.       return (int)((char **)r - st->data);
      269. > }
      270.   
      271.   int sk_find(_STACK *st, void *data)

crypto/stack/stack.c:274:1: return from a call to sk_find
    272.   {
    273.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    274. > }
    275.   
    276.   int sk_find_ex(_STACK *st, void *data)

crypto/x509/x509_trs.c:163:9: Taking false branch
  161.           return -1;
  162.       idx = sk_X509_TRUST_find(trtable, &tmp);
  163.       if (idx == -1)
                 ^
  164.           return -1;
  165.       return idx + X509_TRUST_COUNT;

crypto/x509/x509_trs.c:165:5: 
  163.       if (idx == -1)
  164.           return -1;
  165. >     return idx + X509_TRUST_COUNT;
  166.   }
  167.   

crypto/x509/x509_trs.c:166:1: return from a call to X509_TRUST_get_by_id
  164.           return -1;
  165.       return idx + X509_TRUST_COUNT;
  166. > }
  167.   
  168.   int X509_TRUST_set(int *t, int trust)

crypto/x509/x509_trs.c:131:9: Taking false branch
129.       }
130.       idx = X509_TRUST_get_by_id(id);
131.       if (idx == -1)
               ^
132.           return default_trust(id, x, flags);
133.       pt = X509_TRUST_get0(idx);

crypto/x509/x509_trs.c:133:5: 
131.       if (idx == -1)
132.           return default_trust(id, x, flags);
133. >     pt = X509_TRUST_get0(idx);
134.       return pt->check_trust(pt, x, flags);
135.   }

crypto/x509/x509_trs.c:144:1: start of procedure X509_TRUST_get0()
  142.   }
  143.   
  144. > X509_TRUST *X509_TRUST_get0(int idx)
  145.   {
  146.       if (idx < 0)

crypto/x509/x509_trs.c:146:9: Taking false branch
  144.   X509_TRUST *X509_TRUST_get0(int idx)
  145.   {
  146.       if (idx < 0)
                 ^
  147.           return NULL;
  148.       if (idx < (int)X509_TRUST_COUNT)

crypto/x509/x509_trs.c:148:9: Taking false branch
  146.       if (idx < 0)
  147.           return NULL;
  148.       if (idx < (int)X509_TRUST_COUNT)
                 ^
  149.           return trstandard + idx;
  150.       return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);

crypto/x509/x509_trs.c:150:12: Condition is true
  148.       if (idx < (int)X509_TRUST_COUNT)
  149.           return trstandard + idx;
  150.       return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
                    ^
  151.   }
  152.   

crypto/x509/x509_trs.c:150:5: 
  148.       if (idx < (int)X509_TRUST_COUNT)
  149.           return trstandard + idx;
  150. >     return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
  151.   }
  152.   

crypto/stack/stack.c:347:1: start of procedure sk_value()
    345.   }
    346.   
    347. > void *sk_value(const _STACK *st, int i)
    348.   {
    349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
    347.   void *sk_value(const _STACK *st, int i)
    348.   {
    349.       if (!st || (i < 0) || (i >= st->num))
                    ^
    350.           return NULL;
    351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
    347.   void *sk_value(const _STACK *st, int i)
    348.   {
    349.       if (!st || (i < 0) || (i >= st->num))
                           ^
    350.           return NULL;
    351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking true branch
    347.   void *sk_value(const _STACK *st, int i)
    348.   {
    349.       if (!st || (i < 0) || (i >= st->num))
                                      ^
    350.           return NULL;
    351.       return st->data[i];

crypto/stack/stack.c:350:9: 
    348.   {
    349.       if (!st || (i < 0) || (i >= st->num))
    350. >         return NULL;
    351.       return st->data[i];
    352.   }

crypto/stack/stack.c:352:1: return from a call to sk_value
    350.           return NULL;
    351.       return st->data[i];
    352. > }
    353.   
    354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_trs.c:151:1: return from a call to X509_TRUST_get0
  149.           return trstandard + idx;
  150.       return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
  151. > }
  152.   
  153.   int X509_TRUST_get_by_id(int id)

crypto/x509/x509_trs.c:134:5: 
132.           return default_trust(id, x, flags);
133.       pt = X509_TRUST_get0(idx);
134. >     return pt->check_trust(pt, x, flags);
135.   }
136.   
