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


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

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

crypto/stack/stack.c:243:1: start of procedure sk_find()
  241.   	}
  242.   
  243. > int sk_find(STACK *st, char *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, char *data)
  244.   	{
  245. > 	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
  246.   	}
  247.   int sk_find_ex(STACK *st, char *data)

crypto/stack/stack.c:214:1: start of procedure internal_find()
    212.   	}
    213.   
    214. > static int internal_find(STACK *st, char *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 false 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:223:24: 
    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 false 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:223:24: 
    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, char *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, char *data)
  248.   	{

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

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

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

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

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

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

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

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

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

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

crypto/stack/stack.c:308:1: start of procedure sk_value()
  306.   }
  307.   
  308. > char *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.   char *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.   char *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.   char *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.   char *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.   char *sk_set(STACK *st, int i, char *value)

crypto/x509/x509_lu.c:467:7: 
465.   		{
466.   		obj = sk_X509_OBJECT_value(h, i);
467. > 		if (x509_object_cmp((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
468.   			return NULL;
469.   		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)
