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


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

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

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

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

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

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

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

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

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

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

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 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)

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

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

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

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

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

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

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

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

crypto/x509/x509_trs.c:145:9: 
  143.   {
  144.       if (idx < 0)
  145. >         return NULL;
  146.       if (idx < (int)X509_TRUST_COUNT)
  147.           return trstandard + idx;

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

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