[Freeipa-devel] [PATCH] Improvements to collection API

Stephen Gallagher sgallagh at redhat.com
Wed Jul 1 13:12:48 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/30/2009 02:28 PM, Dmitri Pal wrote:
> Stephen Gallagher wrote:
>> On 06/29/2009 06:34 PM, Dmitri Pal wrote:
>>>> Nack.
>>>>
>>>> Your PRIME hash function is dangerously limited. You guarantee an
>>>> overflow on 64-bit systems with strings of 13 characters or more. Worse
>>>> on 32 bit systems. At minimum, declare phash a uint64_t.
>> Furthermore, in
>>>> your algorithm, the strings "mystring" and "mystirng" will produce an
>>>> identical hash. Consider locating a library that provides a safer and
>>>> less collision-prone hash. (I have no recommendations, perhaps someone
>>>> else on the list can help.)
>>>>
>>>> Beyond that, I'm not going to look too deeply into the internals.
>>>> Syntactically everything looks fine on a quick scan. It compiles
>> cleanly
>>>> against the current head and does not break any existing code, so once
>>>> the above change is made, I'm comfortable with committing it and
>> working
>>>> out any bugs later on.
>>>>
> The updated patch with more advanced hash is attached.
> 
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel
> 
> 
> 
> 

These changes look good to me.
Ack.

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkpLYMoACgkQeiVVYja6o6OCWwCcDyvoYq2IWB4byB68se12OlNO
b+4AniKJiD7nkGqOwlLLAsw1ldcu28PR
=Thrd
-----END PGP SIGNATURE-----




More information about the Freeipa-devel mailing list