3.0.x / possible bug in hash.c (function fr_hash_table_walk)

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Tue Mar 11 10:41:07 CET 2014


Hello,

I think there might be a bug in the hash.c (function fr_hash_table_walk).
At line 616 we currently have :

memcpy(&arg, node->data, sizeof(arg));

Shouldn't this be instead :

memcpy(&arg, &node->data, sizeof(arg));


The current behaviour implies that the callback gets the first member of the struct used as hash element (instead of the pointer on the struct).
If this member happens to be the hash key, we can still access the struct itself through fr_hash_table_finddata, but... it's a bit messy !

The walk function is used internally, but from what I understand only to force walking over the hash, without actually accessing its content.



Regards,
Nicolas.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20140311/7da34c0e/attachment.html>


More information about the Freeradius-Devel mailing list