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


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

crypto/x509/x509_trs.c:120:9: Taking false branch
118.   
119.       /* We get this as a default value */
120.       if (id == X509_TRUST_DEFAULT)
               ^
121.           return obj_trust(NID_anyExtendedKeyUsage, x,
122.                            flags | X509_TRUST_DO_SS_COMPAT);

crypto/x509/x509_trs.c:123:5: 
121.           return obj_trust(NID_anyExtendedKeyUsage, x,
122.                            flags | X509_TRUST_DO_SS_COMPAT);
123. >     idx = X509_TRUST_get_by_id(id);
124.       if (idx == -1)
125.           return default_trust(id, x, flags);

crypto/x509/x509_trs.c:146:1: start of procedure X509_TRUST_get_by_id()
  144.   }
  145.   
  146. > int X509_TRUST_get_by_id(int id)
  147.   {
  148.       X509_TRUST tmp;

crypto/x509/x509_trs.c:150:10: Taking true branch
  148.       X509_TRUST tmp;
  149.       int idx;
  150.       if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
                  ^
  151.           return id - X509_TRUST_MIN;
  152.       tmp.trust = id;

crypto/x509/x509_trs.c:150:36: Taking false branch
  148.       X509_TRUST tmp;
  149.       int idx;
  150.       if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
                                            ^
  151.           return id - X509_TRUST_MIN;
  152.       tmp.trust = id;

crypto/x509/x509_trs.c:152:5: 
  150.       if ((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
  151.           return id - X509_TRUST_MIN;
  152. >     tmp.trust = id;
  153.       if (!trtable)
  154.           return -1;

crypto/x509/x509_trs.c:153:10: Taking false branch
  151.           return id - X509_TRUST_MIN;
  152.       tmp.trust = id;
  153.       if (!trtable)
                  ^
  154.           return -1;
  155.       idx = sk_X509_TRUST_find(trtable, &tmp);

crypto/x509/x509_trs.c:155:5: 
  153.       if (!trtable)
  154.           return -1;
  155. >     idx = sk_X509_TRUST_find(trtable, &tmp);
  156.       if (idx == -1)
  157.           return -1;

include/openssl/x509.h:182:1: start of procedure sk_X509_TRUST_find()
    180.   } X509_TRUST;
    181.   
    182. > DEFINE_STACK_OF(X509_TRUST)
    183.   
    184.   /* standard trust ids */

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

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

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

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

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

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

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

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

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

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

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

include/openssl/x509.h:182:1: return from a call to sk_X509_TRUST_find
    180.   } X509_TRUST;
    181.   
    182. > DEFINE_STACK_OF(X509_TRUST)
    183.   
    184.   /* standard trust ids */

crypto/x509/x509_trs.c:156:9: Taking false branch
  154.           return -1;
  155.       idx = sk_X509_TRUST_find(trtable, &tmp);
  156.       if (idx == -1)
                 ^
  157.           return -1;
  158.       return idx + X509_TRUST_COUNT;

crypto/x509/x509_trs.c:158:5: 
  156.       if (idx == -1)
  157.           return -1;
  158. >     return idx + X509_TRUST_COUNT;
  159.   }
  160.   

crypto/x509/x509_trs.c:159:1: return from a call to X509_TRUST_get_by_id
  157.           return -1;
  158.       return idx + X509_TRUST_COUNT;
  159. > }
  160.   
  161.   int X509_TRUST_set(int *t, int trust)

crypto/x509/x509_trs.c:124:9: Taking false branch
122.                            flags | X509_TRUST_DO_SS_COMPAT);
123.       idx = X509_TRUST_get_by_id(id);
124.       if (idx == -1)
               ^
125.           return default_trust(id, x, flags);
126.       pt = X509_TRUST_get0(idx);

crypto/x509/x509_trs.c:126:5: 
124.       if (idx == -1)
125.           return default_trust(id, x, flags);
126. >     pt = X509_TRUST_get0(idx);
127.       return pt->check_trust(pt, x, flags);
128.   }

crypto/x509/x509_trs.c:137:1: start of procedure X509_TRUST_get0()
  135.   }
  136.   
  137. > X509_TRUST *X509_TRUST_get0(int idx)
  138.   {
  139.       if (idx < 0)

crypto/x509/x509_trs.c:139:9: Taking true branch
  137.   X509_TRUST *X509_TRUST_get0(int idx)
  138.   {
  139.       if (idx < 0)
                 ^
  140.           return NULL;
  141.       if (idx < (int)X509_TRUST_COUNT)

crypto/x509/x509_trs.c:140:9: 
  138.   {
  139.       if (idx < 0)
  140. >         return NULL;
  141.       if (idx < (int)X509_TRUST_COUNT)
  142.           return trstandard + idx;

crypto/x509/x509_trs.c:144:1: return from a call to X509_TRUST_get0
  142.           return trstandard + idx;
  143.       return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
  144. > }
  145.   
  146.   int X509_TRUST_get_by_id(int id)

crypto/x509/x509_trs.c:127:5: 
125.           return default_trust(id, x, flags);
126.       pt = X509_TRUST_get0(idx);
127. >     return pt->check_trust(pt, x, flags);
128.   }
129.   
