For some combinations of variable sizes and RAND_MAX value rand_r()
may store less amount bits for seed, than available. Fix it.
This commit is contained in:
parent
499b47780f
commit
9b500bf3eb
@ -86,8 +86,10 @@ int
|
||||
rand_r(unsigned int *ctx)
|
||||
{
|
||||
u_long val = (u_long) *ctx;
|
||||
*ctx = do_rand(&val);
|
||||
return (int) *ctx;
|
||||
int r = do_rand(&val);
|
||||
|
||||
*ctx = (unsigned int) val;
|
||||
return (r);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user