crypto/objects/o_names.c:104: error: NULL_DEREFERENCE
  pointer `name_funcs` last assigned on line 100 could be null and is dereferenced at line 104, column 3.
Showing all 20 steps of the trace


crypto/objects/o_names.c:58:1: start of procedure OBJ_NAME_new_index()
56.   	}
57.   
58. > int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
59.   	int (*cmp_func)(const char *, const char *),
60.   	void (*free_func)(const char *, int, const char *))

crypto/objects/o_names.c:66:6: Taking false branch
64.   	NAME_FUNCS *name_funcs;
65.   
66.   	if (name_funcs_stack == NULL)
           ^
67.   		{
68.   		MemCheck_off();

crypto/objects/o_names.c:72:7: Taking false branch
70.   		MemCheck_on();
71.   		}
72.   	if ((name_funcs_stack == NULL))
            ^
73.   		{
74.   		/* ERROR */

crypto/objects/o_names.c:77:2: 
75.   		return(0);
76.   		}
77. > 	ret=names_type_num;
78.   	names_type_num++;
79.   	for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)

crypto/objects/o_names.c:78:2: 
76.   		}
77.   	ret=names_type_num;
78. > 	names_type_num++;
79.   	for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
80.   		{

crypto/objects/o_names.c:79:7: 
77.   	ret=names_type_num;
78.   	names_type_num++;
79. > 	for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
80.   		{
81.   		MemCheck_off();

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/objects/o_names.c:79:46: Loop condition is false. Leaving loop
77.   	ret=names_type_num;
78.   	names_type_num++;
79.   	for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
                                                   ^
80.   		{
81.   		MemCheck_off();

crypto/objects/o_names.c:100:2: 
98.   		MemCheck_on();
99.   		}
100. > 	name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
101.   	if (hash_func != NULL)
102.   		name_funcs->hash_func = hash_func;

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 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/objects/o_names.c:101:6: Taking false branch
99.   		}
100.   	name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
101.   	if (hash_func != NULL)
            ^
102.   		name_funcs->hash_func = hash_func;
103.   	if (cmp_func != NULL)

crypto/objects/o_names.c:103:6: Taking true branch
101.   	if (hash_func != NULL)
102.   		name_funcs->hash_func = hash_func;
103.   	if (cmp_func != NULL)
            ^
104.   		name_funcs->cmp_func = cmp_func;
105.   	if (free_func != NULL)

crypto/objects/o_names.c:104:3: 
102.   		name_funcs->hash_func = hash_func;
103.   	if (cmp_func != NULL)
104. > 		name_funcs->cmp_func = cmp_func;
105.   	if (free_func != NULL)
106.   		name_funcs->free_func = free_func;
