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


crypto/x509/x509_trs.c:94:1: start of procedure X509_check_trust()
92.   }
93.   
94. > int X509_check_trust(X509 *x, int id, int flags)
95.   {
96.   	X509_TRUST *pt;

crypto/x509/x509_trs.c:98:5: Taking false branch
96.   	X509_TRUST *pt;
97.   	int idx;
98.   	if(id == -1) return 1;
           ^
99.   	if(!(idx = X509_TRUST_get_by_id(id))) return 0;
100.   	pt = X509_TRUST_iget(idx);

crypto/x509/x509_trs.c:99:7: 
97.   	int idx;
98.   	if(id == -1) return 1;
99. > 	if(!(idx = X509_TRUST_get_by_id(id))) return 0;
100.   	pt = X509_TRUST_iget(idx);
101.   	return pt->check_trust(pt, x, flags);

crypto/x509/x509_trs.c:117:1: start of procedure X509_TRUST_get_by_id()
  115.   }
  116.   
  117. > int X509_TRUST_get_by_id(int id)
  118.   {
  119.   	X509_TRUST tmp;

crypto/x509/x509_trs.c:121:6: Taking true branch
  119.   	X509_TRUST tmp;
  120.   	int idx;
  121.   	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
              ^
  122.   				 return id - X509_TRUST_MIN;
  123.   	tmp.trust = id;

crypto/x509/x509_trs.c:121:32: Taking false branch
  119.   	X509_TRUST tmp;
  120.   	int idx;
  121.   	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
                                        ^
  122.   				 return id - X509_TRUST_MIN;
  123.   	tmp.trust = id;

crypto/x509/x509_trs.c:123:2: 
  121.   	if((id >= X509_TRUST_MIN) && (id <= X509_TRUST_MAX))
  122.   				 return id - X509_TRUST_MIN;
  123. > 	tmp.trust = id;
  124.   	if(!trtable) return -1;
  125.   	idx = sk_X509_TRUST_find(trtable, &tmp);

crypto/x509/x509_trs.c:124:6: Taking true branch
  122.   				 return id - X509_TRUST_MIN;
  123.   	tmp.trust = id;
  124.   	if(!trtable) return -1;
              ^
  125.   	idx = sk_X509_TRUST_find(trtable, &tmp);
  126.   	if(idx == -1) return -1;

crypto/x509/x509_trs.c:124:15: 
  122.   				 return id - X509_TRUST_MIN;
  123.   	tmp.trust = id;
  124. > 	if(!trtable) return -1;
  125.   	idx = sk_X509_TRUST_find(trtable, &tmp);
  126.   	if(idx == -1) return -1;

crypto/x509/x509_trs.c:128:1: return from a call to X509_TRUST_get_by_id
  126.   	if(idx == -1) return -1;
  127.   	return idx + X509_TRUST_COUNT;
  128. > }
  129.   
  130.   int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),

crypto/x509/x509_trs.c:99:7: Taking false branch
97.   	int idx;
98.   	if(id == -1) return 1;
99.   	if(!(idx = X509_TRUST_get_by_id(id))) return 0;
             ^
100.   	pt = X509_TRUST_iget(idx);
101.   	return pt->check_trust(pt, x, flags);

crypto/x509/x509_trs.c:100:2: 
98.   	if(id == -1) return 1;
99.   	if(!(idx = X509_TRUST_get_by_id(id))) return 0;
100. > 	pt = X509_TRUST_iget(idx);
101.   	return pt->check_trust(pt, x, flags);
102.   }

crypto/x509/x509_trs.c:110:1: start of procedure X509_TRUST_iget()
  108.   }
  109.   
  110. > X509_TRUST * X509_TRUST_iget(int idx)
  111.   {
  112.   	if(idx < 0) return NULL;

crypto/x509/x509_trs.c:112:5: Taking true branch
  110.   X509_TRUST * X509_TRUST_iget(int idx)
  111.   {
  112.   	if(idx < 0) return NULL;
             ^
  113.   	if(idx < X509_TRUST_COUNT) return trstandard + idx;
  114.   	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);

crypto/x509/x509_trs.c:112:14: 
  110.   X509_TRUST * X509_TRUST_iget(int idx)
  111.   {
  112. > 	if(idx < 0) return NULL;
  113.   	if(idx < X509_TRUST_COUNT) return trstandard + idx;
  114.   	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);

crypto/x509/x509_trs.c:115:1: return from a call to X509_TRUST_iget
  113.   	if(idx < X509_TRUST_COUNT) return trstandard + idx;
  114.   	return sk_X509_TRUST_value(trtable, idx - X509_TRUST_COUNT);
  115. > }
  116.   
  117.   int X509_TRUST_get_by_id(int id)

crypto/x509/x509_trs.c:101:2: 
99.   	if(!(idx = X509_TRUST_get_by_id(id))) return 0;
100.   	pt = X509_TRUST_iget(idx);
101. > 	return pt->check_trust(pt, x, flags);
102.   }
103.   
