mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
DFS: Check os_get_random() result
This use does not really need a strong random number, so fall back to os_random() if a theoretical error case occurs. (CID 72682) Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
24661bbadc
commit
7c0e5b58f9
@ -440,7 +440,8 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
|
||||
if (num_available_chandefs == 0)
|
||||
return NULL;
|
||||
|
||||
os_get_random((u8 *) &_rand, sizeof(_rand));
|
||||
if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
|
||||
_rand = os_random();
|
||||
chan_idx = _rand % num_available_chandefs;
|
||||
dfs_find_channel(iface, &chan, chan_idx, skip_radar);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user