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 40 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:8: Condition is true
  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_trs.c:144:8: Condition is true
  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_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/stack/stack.c:243:1: start of procedure sk_find()
    241.   	}
    242.   
    243. > int sk_find(_STACK *st, void *data)
    244.   	{
    245.   	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

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

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

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

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

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

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

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

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

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

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

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 false 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:132:5: Taking false branch
  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);
  134.   }

crypto/x509/x509_trs.c:133:9: Condition is true
  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);
                 ^
  134.   }
  135.   

crypto/x509/x509_trs.c:133:2: 
  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);
  134.   }
  135.   

crypto/stack/stack.c:308:1: start of procedure sk_value()
    306.   }
    307.   
    308. > void *sk_value(const _STACK *st, int i)
    309.   {
    310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:310:6: Taking false branch
    308.   void *sk_value(const _STACK *st, int i)
    309.   {
    310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                ^
    311.   	return st->data[i];
    312.   }

crypto/stack/stack.c:310:13: Taking false branch
    308.   void *sk_value(const _STACK *st, int i)
    309.   {
    310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                       ^
    311.   	return st->data[i];
    312.   }

crypto/stack/stack.c:310:24: Taking true branch
    308.   void *sk_value(const _STACK *st, int i)
    309.   {
    310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                  ^
    311.   	return st->data[i];
    312.   }

crypto/stack/stack.c:310:39: 
    308.   void *sk_value(const _STACK *st, int i)
    309.   {
    310. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
    311.   	return st->data[i];
    312.   }

crypto/stack/stack.c:312:1: return from a call to sk_value
    310.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
    311.   	return st->data[i];
    312. > }
    313.   
    314.   void *sk_set(_STACK *st, int i, void *value)

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.   
