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


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

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

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

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

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

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

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

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

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

crypto/x509/x509.h:318:1: start of procedure sk_X509_TRUST_find()
    316.   } X509_TRUST;
    317.   
    318. > DECLARE_STACK_OF(X509_TRUST)
    319.   
    320.   typedef struct x509_cert_pair_st {

crypto/stack/stack.c:242:1: start of procedure sk_find()
      240.   	}
      241.   
      242. > int sk_find(STACK *st, char *data)
      243.   	{
      244.   	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:244:2: 
      242.   int sk_find(STACK *st, char *data)
      243.   	{
      244. > 	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
      245.   	}
      246.   int sk_find_ex(STACK *st, char *data)

crypto/stack/stack.c:213:1: start of procedure internal_find()
        211.   	}
        212.   
        213. > static int internal_find(STACK *st, char *data, int ret_val_options)
        214.   	{
        215.   	char **r;

crypto/stack/stack.c:218:5: Taking false branch
        216.   	int i;
        217.   	int (*comp_func)(const void *,const void *);
        218.   	if(st == NULL) return -1;
                   ^
        219.   
        220.   	if (st->comp == NULL)

crypto/stack/stack.c:220:6: Taking true branch
        218.   	if(st == NULL) return -1;
        219.   
        220.   	if (st->comp == NULL)
                    ^
        221.   		{
        222.   		for (i=0; i<st->num; i++)

crypto/stack/stack.c:222:8: 
        220.   	if (st->comp == NULL)
        221.   		{
        222. > 		for (i=0; i<st->num; i++)
        223.   			if (st->data[i] == data)
        224.   				return(i);

crypto/stack/stack.c:222:13: Loop condition is true. Entering loop body
        220.   	if (st->comp == NULL)
        221.   		{
        222.   		for (i=0; i<st->num; i++)
                           ^
        223.   			if (st->data[i] == data)
        224.   				return(i);

crypto/stack/stack.c:223:8: Taking true branch
        221.   		{
        222.   		for (i=0; i<st->num; i++)
        223.   			if (st->data[i] == data)
                      ^
        224.   				return(i);
        225.   		return(-1);

crypto/stack/stack.c:224:5: 
        222.   		for (i=0; i<st->num; i++)
        223.   			if (st->data[i] == data)
        224. > 				return(i);
        225.   		return(-1);
        226.   		}

crypto/stack/stack.c:240:2: return from a call to internal_find
        238.   	if (r == NULL) return(-1);
        239.   	return((int)(r-st->data));
        240.   	}
                ^
        241.   
        242.   int sk_find(STACK *st, char *data)

crypto/stack/stack.c:245:2: return from a call to sk_find
      243.   	{
      244.   	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
      245.   	}
              ^
      246.   int sk_find_ex(STACK *st, char *data)
      247.   	{

crypto/x509/x509.h:318:1: return from a call to sk_X509_TRUST_find
    316.   } X509_TRUST;
    317.   
    318. > DECLARE_STACK_OF(X509_TRUST)
    319.   
    320.   typedef struct x509_cert_pair_st {

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

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

crypto/x509/x509_trs.c:147:1: return from a call to X509_TRUST_get_by_id
  145.   	if(idx == -1) return -1;
  146.   	return idx + X509_TRUST_COUNT;
  147. > }
  148.   
  149.   int X509_TRUST_set(int *t, int trust)

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

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

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

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

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

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

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