crypto/x509/x509_trs.c:117: error: NULL_DEREFERENCE
  pointer `pt` last assigned on line 116 could be null and is dereferenced at line 117, column 9.
Showing all 19 steps of the trace


crypto/x509/x509_trs.c:109:1: start of procedure X509_check_trust()
107.   
108.   
109. > int X509_check_trust(X509 *x, int id, int flags)
110.   {
111.   	X509_TRUST *pt;

crypto/x509/x509_trs.c:113:5: Taking false branch
111.   	X509_TRUST *pt;
112.   	int idx;
113.   	if(id == -1) return 1;
           ^
114.   	idx = X509_TRUST_get_by_id(id);
115.   	if(idx == -1) return default_trust(id, x, flags);

crypto/x509/x509_trs.c:114:2: 
112.   	int idx;
113.   	if(id == -1) return 1;
114. > 	idx = X509_TRUST_get_by_id(id);
115.   	if(idx == -1) return default_trust(id, x, flags);
116.   	pt = X509_TRUST_get0(idx);

crypto/x509/x509_trs.c:133:1: start of procedure X509_TRUST_get_by_id()
  131.   }
  132.   
  133. > int X509_TRUST_get_by_id(int id)
  134.   {
  135.   	X509_TRUST tmp;

crypto/x509/x509_trs.c:137:6: Taking true branch
  135.   	X509_TRUST tmp;
  136.   	int idx;
  137.   	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
              ^
  138.   				 return id - X509_TRUST_MIN;
  139.   	tmp.trust = id;

crypto/x509/x509_trs.c:137:32: Taking false branch
  135.   	X509_TRUST tmp;
  136.   	int idx;
  137.   	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
                                        ^
  138.   				 return id - X509_TRUST_MIN;
  139.   	tmp.trust = id;

crypto/x509/x509_trs.c:139:2: 
  137.   	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
  138.   				 return id - X509_TRUST_MIN;
  139. > 	tmp.trust = id;
  140.   	if(!trtable) return -1;
  141.   	idx = sk_X509_TRUST_find(trtable, &tmp);

crypto/x509/x509_trs.c:140:6: Taking false branch
  138.   				 return id - X509_TRUST_MIN;
  139.   	tmp.trust = id;
  140.   	if(!trtable) return -1;
              ^
  141.   	idx = sk_X509_TRUST_find(trtable, &tmp);
  142.   	if(idx == -1) return -1;

crypto/x509/x509_trs.c:141:2: Skipping sk_find(): empty list of specs
  139.   	tmp.trust = id;
  140.   	if(!trtable) return -1;
  141.   	idx = sk_X509_TRUST_find(trtable, &tmp);
          ^
  142.   	if(idx == -1) return -1;
  143.   	return idx + X509_TRUST_COUNT;

crypto/x509/x509_trs.c:142:5: Taking false branch
  140.   	if(!trtable) return -1;
  141.   	idx = sk_X509_TRUST_find(trtable, &tmp);
  142.   	if(idx == -1) return -1;
             ^
  143.   	return idx + X509_TRUST_COUNT;
  144.   }

crypto/x509/x509_trs.c:143:2: 
  141.   	idx = sk_X509_TRUST_find(trtable, &tmp);
  142.   	if(idx == -1) return -1;
  143. > 	return idx + X509_TRUST_COUNT;
  144.   }
  145.   

crypto/x509/x509_trs.c:144:1: return from a call to X509_TRUST_get_by_id
  142.   	if(idx == -1) return -1;
  143.   	return idx + X509_TRUST_COUNT;
  144. > }
  145.   
  146.   int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),

crypto/x509/x509_trs.c:115:5: Taking false branch
113.   	if(id == -1) return 1;
114.   	idx = X509_TRUST_get_by_id(id);
115.   	if(idx == -1) return default_trust(id, x, flags);
           ^
116.   	pt = X509_TRUST_get0(idx);
117.   	return pt->check_trust(pt, x, flags);

crypto/x509/x509_trs.c:116:2: 
114.   	idx = X509_TRUST_get_by_id(id);
115.   	if(idx == -1) return default_trust(id, x, flags);
116. > 	pt = X509_TRUST_get0(idx);
117.   	return pt->check_trust(pt, x, flags);
118.   }

crypto/x509/x509_trs.c:126:1: start of procedure X509_TRUST_get0()
  124.   }
  125.   
  126. > X509_TRUST * X509_TRUST_get0(int idx)
  127.   {
  128.   	if(idx < 0) return NULL;

crypto/x509/x509_trs.c:128:5: Taking true branch
  126.   X509_TRUST * X509_TRUST_get0(int idx)
  127.   {
  128.   	if(idx < 0) return NULL;
             ^
  129.   	if(idx < X509_TRUST_COUNT) return trstandard + idx;
  130.   	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);

crypto/x509/x509_trs.c:128:14: 
  126.   X509_TRUST * X509_TRUST_get0(int idx)
  127.   {
  128. > 	if(idx < 0) return NULL;
  129.   	if(idx < X509_TRUST_COUNT) return trstandard + idx;
  130.   	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);

crypto/x509/x509_trs.c:131:1: return from a call to X509_TRUST_get0
  129.   	if(idx < X509_TRUST_COUNT) return trstandard + idx;
  130.   	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
  131. > }
  132.   
  133.   int X509_TRUST_get_by_id(int id)

crypto/x509/x509_trs.c:117:2: 
115.   	if(idx == -1) return default_trust(id, x, flags);
116.   	pt = X509_TRUST_get0(idx);
117. > 	return pt->check_trust(pt, x, flags);
118.   }
119.   
