ndis(4): Avoid overflow.
This is a long standing problem: our random() function returns an unsigned integer but the rand provided by ndis(4) returns an int. Scale it down. MFC after: 2 weeks
This commit is contained in:
parent
0e6d3c6d16
commit
c515200599
@ -3189,7 +3189,7 @@ static int
|
||||
rand(void)
|
||||
{
|
||||
|
||||
return (random());
|
||||
return (random() / 2 + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user