crypto/x509/x509_lu.c:466: error: NULL_DEREFERENCE
  pointer `&obj` last assigned on line 465 could be null and is dereferenced by call to `x509_object_cmp()` at line 466, column 7.
Showing all 38 steps of the trace


crypto/x509/x509_lu.c:456:1: start of procedure X509_OBJECT_retrieve_match()
454.   }
455.   
456. > X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x)
457.   {
458.   	int idx, i;

crypto/x509/x509_lu.c:460:2: 
458.   	int idx, i;
459.   	X509_OBJECT *obj;
460. > 	idx = sk_X509_OBJECT_find(h, x);
461.   	if (idx == -1) return NULL;
462.   	if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);

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 false 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:222:24: 
    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 false 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:222:24: 
    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_lu.c:461:6: Taking false branch
459.   	X509_OBJECT *obj;
460.   	idx = sk_X509_OBJECT_find(h, x);
461.   	if (idx == -1) return NULL;
            ^
462.   	if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);
463.   	for (i = idx; i < sk_X509_OBJECT_num(h); i++)

crypto/x509/x509_lu.c:462:6: Taking false branch
460.   	idx = sk_X509_OBJECT_find(h, x);
461.   	if (idx == -1) return NULL;
462.   	if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);
            ^
463.   	for (i = idx; i < sk_X509_OBJECT_num(h); i++)
464.   		{

crypto/x509/x509_lu.c:463:7: 
461.   	if (idx == -1) return NULL;
462.   	if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);
463. > 	for (i = idx; i < sk_X509_OBJECT_num(h); i++)
464.   		{
465.   		obj = sk_X509_OBJECT_value(h, i);

crypto/x509/x509_lu.c:463:16: 
461.   	if (idx == -1) return NULL;
462.   	if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);
463. > 	for (i = idx; i < sk_X509_OBJECT_num(h); i++)
464.   		{
465.   		obj = sk_X509_OBJECT_value(h, i);

crypto/stack/stack.c:301:1: start of procedure sk_num()
  299.   	}
  300.   
  301. > int sk_num(const STACK *st)
  302.   {
  303.   	if(st == NULL) return -1;

crypto/stack/stack.c:303:5: Taking false branch
  301.   int sk_num(const STACK *st)
  302.   {
  303.   	if(st == NULL) return -1;
             ^
  304.   	return st->num;
  305.   }

crypto/stack/stack.c:304:2: 
  302.   {
  303.   	if(st == NULL) return -1;
  304. > 	return st->num;
  305.   }
  306.   

crypto/stack/stack.c:305:1: return from a call to sk_num
  303.   	if(st == NULL) return -1;
  304.   	return st->num;
  305. > }
  306.   
  307.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_lu.c:463:16: Loop condition is true. Entering loop body
461.   	if (idx == -1) return NULL;
462.   	if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);
463.   	for (i = idx; i < sk_X509_OBJECT_num(h); i++)
                      ^
464.   		{
465.   		obj = sk_X509_OBJECT_value(h, i);

crypto/x509/x509_lu.c:465:3: 
463.   	for (i = idx; i < sk_X509_OBJECT_num(h); i++)
464.   		{
465. > 		obj = sk_X509_OBJECT_value(h, i);
466.   		if (x509_object_cmp((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
467.   			return NULL;

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

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

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

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

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

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

crypto/x509/x509_lu.c:466:7: 
464.   		{
465.   		obj = sk_X509_OBJECT_value(h, i);
466. > 		if (x509_object_cmp((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
467.   			return NULL;
468.   		if ((x->type != X509_LU_X509) || !X509_cmp(obj->data.x509, x->data.x509))

crypto/x509/x509_lu.c:157:1: start of procedure x509_object_cmp()
  155.   
  156.     
  157. > static int x509_object_cmp(const X509_OBJECT * const *a, const X509_OBJECT * const *b)
  158.     	{
  159.    	int ret;

crypto/x509/x509_lu.c:161:3: 
  159.    	int ret;
  160.   
  161. >  	ret=((*a)->type - (*b)->type);
  162.    	if (ret) return ret;
  163.    	switch ((*a)->type)
