mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
os_unix: Call srandom() only if os_get_random() succeeds
Don't use uninitialized stack memory if /dev/urandom is not available. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
17ba51b14d
commit
a17cbcd698
@ -367,7 +367,7 @@ int os_program_init(void)
|
||||
capset(&header, &cap);
|
||||
#endif /* ANDROID */
|
||||
|
||||
os_get_random((unsigned char *) &seed, sizeof(seed));
|
||||
if (os_get_random((unsigned char *) &seed, sizeof(seed)) == 0)
|
||||
srandom(seed);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user