Radius server crash due to 35# bug

Alan DeKok aland at deployingradius.com
Wed Apr 14 04:44:40 CEST 2010


Liu Linyong wrote:
> Hello Alan,
> 
> I have a question. For V2-1-7, in hash.c, please refer to the follows, 
> 
> static int list_delete(fr_hash_table_t *ht,
> 		       fr_hash_entry_t **head, fr_hash_entry_t *node)
> {
> ......
> 	for (cur = *head; cur != &ht->null; cur = cur->next) {
> 		if (cur == node) {    //  WHY NOT "if (cur->reversed == node->reversed)"  ???

  On closer inspection, this function should just be:

	...
	for (cur = *head; cur != &ht->null; cur = cur->next) {
		if (cur == node) break;
		last = &(cur->next);
	}
	...

  The only caller has already ensured that 'node' points to an entry in
that list.  So if 'cur == node', the 'cur' entry is deleted.

  Alan DeKok.



More information about the Freeradius-Devel mailing list