mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-26 13:49:35 -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);
|
capset(&header, &cap);
|
||||||
#endif /* ANDROID */
|
#endif /* ANDROID */
|
||||||
|
|
||||||
os_get_random((unsigned char *) &seed, sizeof(seed));
|
if (os_get_random((unsigned char *) &seed, sizeof(seed)) == 0)
|
||||||
srandom(seed);
|
srandom(seed);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user