mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
Verify that os_get_time() does not fail before using the time value when
registering an eloop timeout.
This commit is contained in:
parent
72822e7be4
commit
a6ee047fcb
@ -242,7 +242,10 @@ int eloop_register_timeout(unsigned int secs, unsigned int usecs,
|
||||
timeout = os_malloc(sizeof(*timeout));
|
||||
if (timeout == NULL)
|
||||
return -1;
|
||||
os_get_time(&timeout->time);
|
||||
if (os_get_time(&timeout->time) < 0) {
|
||||
os_free(timeout);
|
||||
return -1;
|
||||
}
|
||||
timeout->time.sec += secs;
|
||||
timeout->time.usec += usecs;
|
||||
while (timeout->time.usec >= 1000000) {
|
||||
|
Loading…
Reference in New Issue
Block a user