BUG: glibc-2.5.1-arc4_prng-2.patch breaks strfry

Jan Dvorak mordae at anilinux.org
Sun May 4 11:06:50 PDT 2008


> The intention was to use high quality randomness whereever possible. Do you 
> see any way arc4random() can continue to be used?

You can use arc4random() to get randomness to mix up the characters.
User don't have any way to make strfry() return non-random result, so
you can as well use a better function here.

That aside, current state is a terrible error. You can not return (char) 
instead of (char *). You have to return pointer to some memory, moreover, 
pointer to the very same memory you got as an argument. The return value is 
merely a convenience and it is expected for strfry to modify the argument.

More information about the hlfs-dev mailing list